Merge
This commit is contained in:
commit
18bd522b75
@ -1447,9 +1447,10 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces a VarHandle giving access to non-static fields of type
|
* Produces a VarHandle giving access to a non-static field {@code name}
|
||||||
* {@code T} declared by a receiver class of type {@code R}, supporting
|
* of type {@code type} declared in a class of type {@code recv}.
|
||||||
* shape {@code (R : T)}.
|
* The VarHandle's variable type is {@code type} and it has one
|
||||||
|
* coordinate type, {@code recv}.
|
||||||
* <p>
|
* <p>
|
||||||
* Access checking is performed immediately on behalf of the lookup
|
* Access checking is performed immediately on behalf of the lookup
|
||||||
* class.
|
* class.
|
||||||
@ -1472,7 +1473,7 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method
|
|||||||
* <p>
|
* <p>
|
||||||
* If the field is declared {@code volatile} then the returned VarHandle
|
* If the field is declared {@code volatile} then the returned VarHandle
|
||||||
* will override access to the field (effectively ignore the
|
* will override access to the field (effectively ignore the
|
||||||
* {@code volatile} declaration) in accordance to it's specified
|
* {@code volatile} declaration) in accordance to its specified
|
||||||
* access modes.
|
* access modes.
|
||||||
* <p>
|
* <p>
|
||||||
* If the field type is {@code float} or {@code double} then numeric
|
* If the field type is {@code float} or {@code double} then numeric
|
||||||
@ -1568,9 +1569,10 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces a VarHandle giving access to a static field of type
|
* Produces a VarHandle giving access to a static field {@code name} of
|
||||||
* {@code T} declared by a given declaring class, supporting shape
|
* type {@code type} declared in a class of type {@code decl}.
|
||||||
* {@code ((empty) : T)}.
|
* The VarHandle's variable type is {@code type} and it has no
|
||||||
|
* coordinate types.
|
||||||
* <p>
|
* <p>
|
||||||
* Access checking is performed immediately on behalf of the lookup
|
* Access checking is performed immediately on behalf of the lookup
|
||||||
* class.
|
* class.
|
||||||
@ -1596,7 +1598,7 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method
|
|||||||
* <p>
|
* <p>
|
||||||
* If the field is declared {@code volatile} then the returned VarHandle
|
* If the field is declared {@code volatile} then the returned VarHandle
|
||||||
* will override access to the field (effectively ignore the
|
* will override access to the field (effectively ignore the
|
||||||
* {@code volatile} declaration) in accordance to it's specified
|
* {@code volatile} declaration) in accordance to its specified
|
||||||
* access modes.
|
* access modes.
|
||||||
* <p>
|
* <p>
|
||||||
* If the field type is {@code float} or {@code double} then numeric
|
* If the field type is {@code float} or {@code double} then numeric
|
||||||
@ -1691,7 +1693,13 @@ return mh1;
|
|||||||
public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
|
public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
|
||||||
Class<? extends Object> refc = receiver.getClass(); // may get NPE
|
Class<? extends Object> refc = receiver.getClass(); // may get NPE
|
||||||
MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type);
|
MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type);
|
||||||
MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, findBoundCallerClass(method));
|
MethodHandle mh = getDirectMethodNoRestrictInvokeSpecial(refc, method, findBoundCallerClass(method));
|
||||||
|
if (!mh.type().leadingReferenceParameter().isAssignableFrom(receiver.getClass())) {
|
||||||
|
throw new IllegalAccessException("The restricted defining class " +
|
||||||
|
mh.type().leadingReferenceParameter().getName() +
|
||||||
|
" is not assignable from receiver class " +
|
||||||
|
receiver.getClass().getName());
|
||||||
|
}
|
||||||
return mh.bindArgumentL(0, receiver).setVarargs(method);
|
return mh.bindArgumentL(0, receiver).setVarargs(method);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1877,11 +1885,12 @@ return mh1;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces a VarHandle that accesses fields of type {@code T} declared
|
* Produces a VarHandle giving access to a reflected field {@code f}
|
||||||
* by a class of type {@code R}, as described by the given reflected
|
* of type {@code T} declared in a class of type {@code R}.
|
||||||
* field.
|
* The VarHandle's variable type is {@code T}.
|
||||||
* If the field is non-static the VarHandle supports a shape of
|
* If the field is non-static the VarHandle has one coordinate type,
|
||||||
* {@code (R : T)}, otherwise supports a shape of {@code ((empty) : T)}.
|
* {@code R}. Otherwise, the field is static, and the VarHandle has no
|
||||||
|
* coordinate types.
|
||||||
* <p>
|
* <p>
|
||||||
* Access checking is performed immediately on behalf of the lookup
|
* Access checking is performed immediately on behalf of the lookup
|
||||||
* class, regardless of the value of the field's {@code accessible}
|
* class, regardless of the value of the field's {@code accessible}
|
||||||
@ -1909,7 +1918,7 @@ return mh1;
|
|||||||
* <p>
|
* <p>
|
||||||
* If the field is declared {@code volatile} then the returned VarHandle
|
* If the field is declared {@code volatile} then the returned VarHandle
|
||||||
* will override access to the field (effectively ignore the
|
* will override access to the field (effectively ignore the
|
||||||
* {@code volatile} declaration) in accordance to it's specified
|
* {@code volatile} declaration) in accordance to its specified
|
||||||
* access modes.
|
* access modes.
|
||||||
* <p>
|
* <p>
|
||||||
* If the field type is {@code float} or {@code double} then numeric
|
* If the field type is {@code float} or {@code double} then numeric
|
||||||
@ -2240,7 +2249,7 @@ return mh1;
|
|||||||
throw method.makeAccessException("caller class must be a subclass below the method", caller);
|
throw method.makeAccessException("caller class must be a subclass below the method", caller);
|
||||||
}
|
}
|
||||||
MethodType rawType = mh.type();
|
MethodType rawType = mh.type();
|
||||||
if (rawType.parameterType(0) == caller) return mh;
|
if (caller.isAssignableFrom(rawType.parameterType(0))) return mh; // no need to restrict; already narrow
|
||||||
MethodType narrowType = rawType.changeParameterType(0, caller);
|
MethodType narrowType = rawType.changeParameterType(0, caller);
|
||||||
assert(!mh.isVarargsCollector()); // viewAsType will lose varargs-ness
|
assert(!mh.isVarargsCollector()); // viewAsType will lose varargs-ness
|
||||||
assert(mh.viewAsTypeChecks(narrowType, true));
|
assert(mh.viewAsTypeChecks(narrowType, true));
|
||||||
@ -2253,11 +2262,11 @@ return mh1;
|
|||||||
final boolean checkSecurity = true;
|
final boolean checkSecurity = true;
|
||||||
return getDirectMethodCommon(refKind, refc, method, checkSecurity, doRestrict, callerClass);
|
return getDirectMethodCommon(refKind, refc, method, checkSecurity, doRestrict, callerClass);
|
||||||
}
|
}
|
||||||
/** Check access and get the requested method, eliding receiver narrowing rules. */
|
/** Check access and get the requested method, for invokespecial with no restriction on the application of narrowing rules. */
|
||||||
private MethodHandle getDirectMethodNoRestrict(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
|
private MethodHandle getDirectMethodNoRestrictInvokeSpecial(Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
|
||||||
final boolean doRestrict = false;
|
final boolean doRestrict = false;
|
||||||
final boolean checkSecurity = true;
|
final boolean checkSecurity = true;
|
||||||
return getDirectMethodCommon(refKind, refc, method, checkSecurity, doRestrict, callerClass);
|
return getDirectMethodCommon(REF_invokeSpecial, refc, method, checkSecurity, doRestrict, callerClass);
|
||||||
}
|
}
|
||||||
/** Check access and get the requested method, eliding security manager checks. */
|
/** Check access and get the requested method, eliding security manager checks. */
|
||||||
private MethodHandle getDirectMethodNoSecurityManager(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
|
private MethodHandle getDirectMethodNoSecurityManager(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
|
||||||
@ -2309,10 +2318,8 @@ return mh1;
|
|||||||
DirectMethodHandle dmh = DirectMethodHandle.make(refKind, refc, method);
|
DirectMethodHandle dmh = DirectMethodHandle.make(refKind, refc, method);
|
||||||
MethodHandle mh = dmh;
|
MethodHandle mh = dmh;
|
||||||
// Optionally narrow the receiver argument to refc using restrictReceiver.
|
// Optionally narrow the receiver argument to refc using restrictReceiver.
|
||||||
if (doRestrict &&
|
if ((doRestrict && refKind == REF_invokeSpecial) ||
|
||||||
(refKind == REF_invokeSpecial ||
|
(MethodHandleNatives.refKindHasReceiver(refKind) && restrictProtectedReceiver(method))) {
|
||||||
(MethodHandleNatives.refKindHasReceiver(refKind) &&
|
|
||||||
restrictProtectedReceiver(method)))) {
|
|
||||||
mh = restrictReceiver(method, dmh, lookupClass());
|
mh = restrictReceiver(method, dmh, lookupClass());
|
||||||
}
|
}
|
||||||
mh = maybeBindCaller(method, mh, callerClass);
|
mh = maybeBindCaller(method, mh, callerClass);
|
||||||
@ -2572,9 +2579,11 @@ return mh1;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Produces a VarHandle giving access to elements of an array of type
|
||||||
* Produces a VarHandle giving access to elements of an array type
|
* {@code arrayClass}. The VarHandle's variable type is the component type
|
||||||
* {@code T[]}, supporting shape {@code (T[], int : T)}.
|
* of {@code arrayClass} and the list of coordinate types is
|
||||||
|
* {@code (arrayClass, int)}, where the {@code int} coordinate type
|
||||||
|
* corresponds to an argument that is an index into an array.
|
||||||
* <p>
|
* <p>
|
||||||
* Certain access modes of the returned VarHandle are unsupported under
|
* Certain access modes of the returned VarHandle are unsupported under
|
||||||
* the following conditions:
|
* the following conditions:
|
||||||
@ -2629,13 +2638,14 @@ return mh1;
|
|||||||
/**
|
/**
|
||||||
* Produces a VarHandle giving access to elements of a {@code byte[]} array
|
* Produces a VarHandle giving access to elements of a {@code byte[]} array
|
||||||
* viewed as if it were a different primitive array type, such as
|
* viewed as if it were a different primitive array type, such as
|
||||||
* {@code int[]} or {@code long[]}. The shape of the resulting VarHandle is
|
* {@code int[]} or {@code long[]}.
|
||||||
* {@code (byte[], int : T)}, where the {@code int} coordinate type
|
* The VarHandle's variable type is the component type of
|
||||||
* corresponds to an argument that is an index in a {@code byte[]} array,
|
* {@code viewArrayClass} and the list of coordinate types is
|
||||||
* and {@code T} is the component type of the given view array class. The
|
* {@code (byte[], int)}, where the {@code int} coordinate type
|
||||||
* returned VarHandle accesses bytes at an index in a {@code byte[]} array,
|
* corresponds to an argument that is an index into a {@code byte[]} array.
|
||||||
* composing bytes to or from a value of {@code T} according to the given
|
* The returned VarHandle accesses bytes at an index in a {@code byte[]}
|
||||||
* endianness.
|
* array, composing bytes to or from a value of the component type of
|
||||||
|
* {@code viewArrayClass} according to the given endianness.
|
||||||
* <p>
|
* <p>
|
||||||
* The supported component types (variables types) are {@code short},
|
* The supported component types (variables types) are {@code short},
|
||||||
* {@code char}, {@code int}, {@code long}, {@code float} and
|
* {@code char}, {@code int}, {@code long}, {@code float} and
|
||||||
@ -2713,13 +2723,14 @@ return mh1;
|
|||||||
* Produces a VarHandle giving access to elements of a {@code ByteBuffer}
|
* Produces a VarHandle giving access to elements of a {@code ByteBuffer}
|
||||||
* viewed as if it were an array of elements of a different primitive
|
* viewed as if it were an array of elements of a different primitive
|
||||||
* component type to that of {@code byte}, such as {@code int[]} or
|
* component type to that of {@code byte}, such as {@code int[]} or
|
||||||
* {@code long[]}. The shape of the resulting VarHandle is
|
* {@code long[]}.
|
||||||
* {@code (ByteBuffer, int : T)}, where the {@code int} coordinate type
|
* The VarHandle's variable type is the component type of
|
||||||
* corresponds to an argument that is an index in a {@code ByteBuffer}, and
|
* {@code viewArrayClass} and the list of coordinate types is
|
||||||
* {@code T} is the component type of the given view array class. The
|
* {@code (ByteBuffer, int)}, where the {@code int} coordinate type
|
||||||
* returned VarHandle accesses bytes at an index in a {@code ByteBuffer},
|
* corresponds to an argument that is an index into a {@code byte[]} array.
|
||||||
* composing bytes to or from a value of {@code T} according to the given
|
* The returned VarHandle accesses bytes at an index in a
|
||||||
* endianness.
|
* {@code ByteBuffer}, composing bytes to or from a value of the component
|
||||||
|
* type of {@code viewArrayClass} according to the given endianness.
|
||||||
* <p>
|
* <p>
|
||||||
* The supported component types (variables types) are {@code short},
|
* The supported component types (variables types) are {@code short},
|
||||||
* {@code char}, {@code int}, {@code long}, {@code float} and
|
* {@code char}, {@code int}, {@code long}, {@code float} and
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -54,7 +54,7 @@ import java.util.Date;
|
|||||||
* <b>Security permissions</b>
|
* <b>Security permissions</b>
|
||||||
* <p>
|
* <p>
|
||||||
* If a security manager is installed, and if a method is called which results in an
|
* If a security manager is installed, and if a method is called which results in an
|
||||||
* attempt to open a connection, the caller must possess either:-
|
* attempt to open a connection, the caller must possess either:
|
||||||
* <ul><li>a "connect" {@link SocketPermission} to the host/port combination of the
|
* <ul><li>a "connect" {@link SocketPermission} to the host/port combination of the
|
||||||
* destination URL or</li>
|
* destination URL or</li>
|
||||||
* <li>a {@link URLPermission} that permits this request.</li>
|
* <li>a {@link URLPermission} that permits this request.</li>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -93,7 +93,7 @@ public class CipherInputStream extends FilterInputStream {
|
|||||||
// stream status
|
// stream status
|
||||||
private boolean closed = false;
|
private boolean closed = false;
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* private convenience function.
|
* private convenience function.
|
||||||
*
|
*
|
||||||
* Entry condition: ostart = ofinish
|
* Entry condition: ostart = ofinish
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -196,19 +196,19 @@ class CryptoPermission extends java.security.Permission {
|
|||||||
* Checks if the specified permission is "implied" by
|
* Checks if the specified permission is "implied" by
|
||||||
* this object.
|
* this object.
|
||||||
* <p>
|
* <p>
|
||||||
* More specifically, this method returns true if:<p>
|
* More specifically, this method returns true if:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li> <i>p</i> is an instance of CryptoPermission, and<p>
|
* <li> <i>p</i> is an instance of CryptoPermission, and</li>
|
||||||
* <li> <i>p</i>'s algorithm name equals or (in the case of wildcards)
|
* <li> <i>p</i>'s algorithm name equals or (in the case of wildcards)
|
||||||
* is implied by this permission's algorithm name, and<p>
|
* is implied by this permission's algorithm name, and</li>
|
||||||
* <li> <i>p</i>'s maximum allowable key size is less or
|
* <li> <i>p</i>'s maximum allowable key size is less or
|
||||||
* equal to this permission's maximum allowable key size, and<p>
|
* equal to this permission's maximum allowable key size, and</li>
|
||||||
* <li> <i>p</i>'s algorithm parameter spec equals or is
|
* <li> <i>p</i>'s algorithm parameter spec equals or is
|
||||||
* implied by this permission's algorithm parameter spec, and<p>
|
* implied by this permission's algorithm parameter spec, and</li>
|
||||||
* <li> <i>p</i>'s exemptionMechanism equals or
|
* <li> <i>p</i>'s exemptionMechanism equals or
|
||||||
* is implied by this permission's
|
* is implied by this permission's
|
||||||
* exemptionMechanism (a <code>null</code> exemption mechanism
|
* exemptionMechanism (a <code>null</code> exemption mechanism
|
||||||
* implies any other exemption mechanism).
|
* implies any other exemption mechanism).</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param p the permission to check against.
|
* @param p the permission to check against.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -46,10 +46,12 @@ import java.lang.reflect.*;
|
|||||||
*
|
*
|
||||||
* The format of a permission entry in the jurisdiction policy file is:
|
* The format of a permission entry in the jurisdiction policy file is:
|
||||||
*
|
*
|
||||||
|
* <pre>{@code
|
||||||
* permission <crypto permission class name>[, <algorithm name>
|
* permission <crypto permission class name>[, <algorithm name>
|
||||||
* [[, <exemption mechanism name>][, <maxKeySize>
|
* [[, <exemption mechanism name>][, <maxKeySize>
|
||||||
* [, <AlgrithomParameterSpec class name>, <parameters
|
* [, <AlgrithomParameterSpec class name>, <parameters
|
||||||
* for constructing an AlgrithomParameterSpec object>]]]];
|
* for constructing an AlgrithomParameterSpec object>]]]];
|
||||||
|
* }</pre>
|
||||||
*
|
*
|
||||||
* @author Sharon Liu
|
* @author Sharon Liu
|
||||||
*
|
*
|
||||||
@ -526,8 +528,7 @@ final class CryptoPolicyParser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Each grant entry in the policy configuration file is represented by a
|
* Each grant entry in the policy configuration file is represented by a
|
||||||
* GrantEntry object. <p>
|
* GrantEntry object.
|
||||||
*
|
|
||||||
* <p>
|
* <p>
|
||||||
* For example, the entry
|
* For example, the entry
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -587,8 +588,7 @@ final class CryptoPolicyParser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Each crypto permission entry in the policy configuration file is
|
* Each crypto permission entry in the policy configuration file is
|
||||||
* represented by a CryptoPermissionEntry object. <p>
|
* represented by a CryptoPermissionEntry object.
|
||||||
*
|
|
||||||
* <p>
|
* <p>
|
||||||
* For example, the entry
|
* For example, the entry
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -98,7 +98,7 @@ questions.
|
|||||||
constructor.</p>
|
constructor.</p>
|
||||||
|
|
||||||
|
|
||||||
<h4><a name="servergen">Connector addresses generated by the
|
<h4><a id="servergen">Connector addresses generated by the
|
||||||
server</a></h4>
|
server</a></h4>
|
||||||
|
|
||||||
<p>If the <code>serviceURL</code> you specify has an empty URL
|
<p>If the <code>serviceURL</code> you specify has an empty URL
|
||||||
@ -157,7 +157,7 @@ questions.
|
|||||||
<code><em>port</em></code>.</p>
|
<code><em>port</em></code>.</p>
|
||||||
|
|
||||||
|
|
||||||
<h4><a name="directory">Connector addresses based on directory
|
<h4><a id="directory">Connector addresses based on directory
|
||||||
entries</a></h4>
|
entries</a></h4>
|
||||||
|
|
||||||
<p>As an alternative to the generated addresses just described,
|
<p>As an alternative to the generated addresses just described,
|
||||||
|
@ -34,7 +34,7 @@ import sun.management.LockInfoCompositeData;
|
|||||||
* an <em>ownable synchronizer</em>, or the {@link Condition Condition}
|
* an <em>ownable synchronizer</em>, or the {@link Condition Condition}
|
||||||
* object associated with synchronizers.
|
* object associated with synchronizers.
|
||||||
* <p>
|
* <p>
|
||||||
* <a name="OwnableSynchronizer">An ownable synchronizer</a> is
|
* <a id="OwnableSynchronizer">An ownable synchronizer</a> is
|
||||||
* a synchronizer that may be exclusively owned by a thread and uses
|
* a synchronizer that may be exclusively owned by a thread and uses
|
||||||
* {@link AbstractOwnableSynchronizer AbstractOwnableSynchronizer}
|
* {@link AbstractOwnableSynchronizer AbstractOwnableSynchronizer}
|
||||||
* (or its subclass) to implement its synchronization property.
|
* (or its subclass) to implement its synchronization property.
|
||||||
@ -42,7 +42,7 @@ import sun.management.LockInfoCompositeData;
|
|||||||
* the read-lock) of {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
|
* the read-lock) of {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
|
||||||
* two examples of ownable synchronizers provided by the platform.
|
* two examples of ownable synchronizers provided by the platform.
|
||||||
*
|
*
|
||||||
* <h3><a name="MappedType">MXBean Mapping</a></h3>
|
* <h3><a id="MappedType">MXBean Mapping</a></h3>
|
||||||
* {@code LockInfo} is mapped to a {@link CompositeData CompositeData}
|
* {@code LockInfo} is mapped to a {@link CompositeData CompositeData}
|
||||||
* as specified in the {@link #from from} method.
|
* as specified in the {@link #from from} method.
|
||||||
*
|
*
|
||||||
@ -105,10 +105,11 @@ public class LockInfo {
|
|||||||
* given {@code CompositeData}.
|
* given {@code CompositeData}.
|
||||||
* The given {@code CompositeData} must contain the following attributes:
|
* The given {@code CompositeData} must contain the following attributes:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The attributes and the types the given CompositeData contains">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The attributes and the types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>className</td>
|
* <td>className</td>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -67,7 +67,7 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
|
|||||||
* the management interface of a component of the Java virtual
|
* the management interface of a component of the Java virtual
|
||||||
* machine.
|
* machine.
|
||||||
*
|
*
|
||||||
* <h3><a name="MXBean">Platform MXBeans</a></h3>
|
* <h3><a id="MXBean">Platform MXBeans</a></h3>
|
||||||
* <p>
|
* <p>
|
||||||
* A platform MXBean is a <i>managed bean</i> that
|
* A platform MXBean is a <i>managed bean</i> that
|
||||||
* conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
|
* conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
|
||||||
@ -83,7 +83,7 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
|
|||||||
* See <a href="../../../javax/management/MXBean.html#MXBean-spec">
|
* See <a href="../../../javax/management/MXBean.html#MXBean-spec">
|
||||||
* the specification of MXBeans</a> for details.
|
* the specification of MXBeans</a> for details.
|
||||||
*
|
*
|
||||||
* <a name="MXBeanNames"></a>
|
* <a id="MXBeanNames"></a>
|
||||||
* <p>Each platform MXBean is a {@link PlatformManagedObject}
|
* <p>Each platform MXBean is a {@link PlatformManagedObject}
|
||||||
* and it has a unique
|
* and it has a unique
|
||||||
* {@link javax.management.ObjectName ObjectName} for
|
* {@link javax.management.ObjectName ObjectName} for
|
||||||
@ -141,7 +141,8 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
|
|||||||
* interfaces:
|
* interfaces:
|
||||||
*
|
*
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The list of Management Interfaces and their single instances">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The list of Management Interfaces and their single instances</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th>Management Interface</th>
|
* <th>Management Interface</th>
|
||||||
* <th>ObjectName</th>
|
* <th>ObjectName</th>
|
||||||
@ -184,7 +185,8 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
|
|||||||
* the following management interfaces.
|
* the following management interfaces.
|
||||||
*
|
*
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The list of Management Interfaces and their single instances">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The list of Management Interfaces and their single instances</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th>Management Interface</th>
|
* <th>Management Interface</th>
|
||||||
* <th>ObjectName</th>
|
* <th>ObjectName</th>
|
||||||
@ -201,7 +203,8 @@ import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
|
|||||||
* A Java virtual machine may have one or more instances of the following
|
* A Java virtual machine may have one or more instances of the following
|
||||||
* management interfaces.
|
* management interfaces.
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The list of Management Interfaces and their single instances">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The list of Management Interfaces and their single instances</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th>Management Interface</th>
|
* <th>Management Interface</th>
|
||||||
* <th>ObjectName</th>
|
* <th>ObjectName</th>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -34,7 +34,8 @@ package java.lang.management;
|
|||||||
* provides a summary description of what the permission allows,
|
* provides a summary description of what the permission allows,
|
||||||
* and discusses the risks of granting code the permission.
|
* and discusses the risks of granting code the permission.
|
||||||
*
|
*
|
||||||
* <table border=1 cellpadding=5 summary="Table shows permission target name, what the permission allows, and associated risks">
|
* <table border="1" cellpadding=5>
|
||||||
|
* <caption style="display:none">Table shows permission target name, what the permission allows, and associated risks</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th>Permission Target Name</th>
|
* <th>Permission Target Name</th>
|
||||||
* <th>What the Permission Allows</th>
|
* <th>What the Permission Allows</th>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -212,10 +212,11 @@ public class MemoryNotificationInfo {
|
|||||||
* The given {@code CompositeData} must contain
|
* The given {@code CompositeData} must contain
|
||||||
* the following attributes:
|
* the following attributes:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The attributes and the types the given CompositeData contains">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The attributes and the types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>poolName</td>
|
* <td>poolName</td>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -71,7 +71,7 @@ package java.lang.management;
|
|||||||
* (only supported by some <em>garbage-collected</em> memory pools)</li>
|
* (only supported by some <em>garbage-collected</em> memory pools)</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <h3><a name="Usage">1. Memory Usage</a></h3>
|
* <h3><a id="Usage">1. Memory Usage</a></h3>
|
||||||
*
|
*
|
||||||
* The {@link #getUsage} method provides an estimate
|
* The {@link #getUsage} method provides an estimate
|
||||||
* of the current usage of a memory pool.
|
* of the current usage of a memory pool.
|
||||||
@ -86,14 +86,14 @@ package java.lang.management;
|
|||||||
* the current memory usage. An implementation should document when
|
* the current memory usage. An implementation should document when
|
||||||
* this is the case.
|
* this is the case.
|
||||||
*
|
*
|
||||||
* <h3><a name="PeakUsage">2. Peak Memory Usage</a></h3>
|
* <h3><a id="PeakUsage">2. Peak Memory Usage</a></h3>
|
||||||
*
|
*
|
||||||
* The Java virtual machine maintains the peak memory usage of a memory
|
* The Java virtual machine maintains the peak memory usage of a memory
|
||||||
* pool since the virtual machine was started or the peak was reset.
|
* pool since the virtual machine was started or the peak was reset.
|
||||||
* The peak memory usage is returned by the {@link #getPeakUsage} method
|
* The peak memory usage is returned by the {@link #getPeakUsage} method
|
||||||
* and reset by calling the {@link #resetPeakUsage} method.
|
* and reset by calling the {@link #resetPeakUsage} method.
|
||||||
*
|
*
|
||||||
* <h3><a name="UsageThreshold">3. Usage Threshold</a></h3>
|
* <h3><a id="UsageThreshold">3. Usage Threshold</a></h3>
|
||||||
*
|
*
|
||||||
* Each memory pool has a manageable attribute
|
* Each memory pool has a manageable attribute
|
||||||
* called the <i>usage threshold</i> which has a default value supplied
|
* called the <i>usage threshold</i> which has a default value supplied
|
||||||
@ -141,7 +141,7 @@ package java.lang.management;
|
|||||||
* <a href="#ThresholdNotification">threshold notification</a> mechanisms.
|
* <a href="#ThresholdNotification">threshold notification</a> mechanisms.
|
||||||
*
|
*
|
||||||
* <ol type="a">
|
* <ol type="a">
|
||||||
* <li><a name="Polling"><b>Polling</b></a>
|
* <li><a id="Polling"><b>Polling</b></a>
|
||||||
* <p>
|
* <p>
|
||||||
* An application can continuously monitor its memory usage
|
* An application can continuously monitor its memory usage
|
||||||
* by calling either the {@link #getUsage} method for all
|
* by calling either the {@link #getUsage} method for all
|
||||||
@ -231,7 +231,7 @@ package java.lang.management;
|
|||||||
* }
|
* }
|
||||||
* </pre><hr>
|
* </pre><hr>
|
||||||
* </li>
|
* </li>
|
||||||
* <li><a name="ThresholdNotification"><b>Usage Threshold Notifications</b></a>
|
* <li><a id="ThresholdNotification"><b>Usage Threshold Notifications</b></a>
|
||||||
* <p>
|
* <p>
|
||||||
* Usage threshold notification will be emitted by {@link MemoryMXBean}.
|
* Usage threshold notification will be emitted by {@link MemoryMXBean}.
|
||||||
* When the Java virtual machine detects that the memory usage of
|
* When the Java virtual machine detects that the memory usage of
|
||||||
@ -304,7 +304,7 @@ package java.lang.management;
|
|||||||
* </li>
|
* </li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*
|
*
|
||||||
* <h3><a name="CollectionThreshold">4. Collection Usage Threshold</a></h3>
|
* <h3><a id="CollectionThreshold">4. Collection Usage Threshold</a></h3>
|
||||||
*
|
*
|
||||||
* Collection usage threshold is a manageable attribute only applicable
|
* Collection usage threshold is a manageable attribute only applicable
|
||||||
* to some garbage-collected memory pools.
|
* to some garbage-collected memory pools.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -36,10 +36,11 @@ import sun.management.MemoryUsageCompositeData;
|
|||||||
* the heap or non-heap memory of the Java virtual machine as a whole.
|
* the heap or non-heap memory of the Java virtual machine as a whole.
|
||||||
*
|
*
|
||||||
* <p> A {@code MemoryUsage} object contains four values:
|
* <p> A {@code MemoryUsage} object contains four values:
|
||||||
* <table summary="Describes the MemoryUsage object content">
|
* <table>
|
||||||
|
* <caption style="display:none">Describes the MemoryUsage object content</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td valign=top> {@code init} </td>
|
* <td style="vertical-align:top"> {@code init} </td>
|
||||||
* <td valign=top> represents the initial amount of memory (in bytes) that
|
* <td style="vertical-align:top"> represents the initial amount of memory (in bytes) that
|
||||||
* the Java virtual machine requests from the operating system
|
* the Java virtual machine requests from the operating system
|
||||||
* for memory management during startup. The Java virtual machine
|
* for memory management during startup. The Java virtual machine
|
||||||
* may request additional memory from the operating system and
|
* may request additional memory from the operating system and
|
||||||
@ -48,13 +49,13 @@ import sun.management.MemoryUsageCompositeData;
|
|||||||
* </td>
|
* </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td valign=top> {@code used} </td>
|
* <td style="vertical-align:top"> {@code used} </td>
|
||||||
* <td valign=top> represents the amount of memory currently used (in bytes).
|
* <td style="vertical-align:top"> represents the amount of memory currently used (in bytes).
|
||||||
* </td>
|
* </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td valign=top> {@code committed} </td>
|
* <td style="vertical-align:top"> {@code committed} </td>
|
||||||
* <td valign=top> represents the amount of memory (in bytes) that is
|
* <td style="vertical-align:top"> represents the amount of memory (in bytes) that is
|
||||||
* guaranteed to be available for use by the Java virtual machine.
|
* guaranteed to be available for use by the Java virtual machine.
|
||||||
* The amount of committed memory may change over time (increase
|
* The amount of committed memory may change over time (increase
|
||||||
* or decrease). The Java virtual machine may release memory to
|
* or decrease). The Java virtual machine may release memory to
|
||||||
@ -64,8 +65,8 @@ import sun.management.MemoryUsageCompositeData;
|
|||||||
* </td>
|
* </td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td valign=top> {@code max} </td>
|
* <td style="vertical-align:top"> {@code max} </td>
|
||||||
* <td valign=top> represents the maximum amount of memory (in bytes)
|
* <td style="vertical-align:top"> represents the maximum amount of memory (in bytes)
|
||||||
* that can be used for memory management. Its value may be undefined.
|
* that can be used for memory management. Its value may be undefined.
|
||||||
* The maximum amount of memory may change over time if defined.
|
* The maximum amount of memory may change over time if defined.
|
||||||
* The amount of used and committed memory will always be less than
|
* The amount of used and committed memory will always be less than
|
||||||
@ -252,10 +253,11 @@ public class MemoryUsage {
|
|||||||
* must contain the following attributes:
|
* must contain the following attributes:
|
||||||
*
|
*
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The attributes and the types the given CompositeData contains">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The attributes and the types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>init</td>
|
* <td>init</td>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -106,10 +106,11 @@ public class MonitorInfo extends LockInfo {
|
|||||||
* <a href="LockInfo.html#MappedType">
|
* <a href="LockInfo.html#MappedType">
|
||||||
* mapped type</a> for the {@link LockInfo} class:
|
* mapped type</a> for the {@link LockInfo} class:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The attributes and their types the given CompositeData contains">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>lockedStackFrame</td>
|
* <td>lockedStackFrame</td>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -312,7 +312,8 @@ public interface RuntimeMXBean extends PlatformManagedObject {
|
|||||||
* {@link javax.management.openmbean.TabularData TabularData}
|
* {@link javax.management.openmbean.TabularData TabularData}
|
||||||
* with two items in each row as follows:
|
* with two items in each row as follows:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="Name and Type for each item">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">Name and Type for each item</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th>Item Name</th>
|
* <th>Item Name</th>
|
||||||
* <th>Item Type</th>
|
* <th>Item Type</th>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -61,7 +61,7 @@ import static java.lang.Thread.State.*;
|
|||||||
* <li>Thread priority</li>
|
* <li>Thread priority</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <h4><a name="SyncStats">Synchronization Statistics</a></h4>
|
* <h4><a id="SyncStats">Synchronization Statistics</a></h4>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The number of times that the thread has blocked for
|
* <li>The number of times that the thread has blocked for
|
||||||
* synchronization or waited for notification.</li>
|
* synchronization or waited for notification.</li>
|
||||||
@ -695,10 +695,11 @@ public class ThreadInfo {
|
|||||||
* The given {@code CompositeData} must contain the following attributes
|
* The given {@code CompositeData} must contain the following attributes
|
||||||
* unless otherwise specified below:
|
* unless otherwise specified below:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table border summary="The attributes and their types the given CompositeData contains">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>threadId</td>
|
* <td>threadId</td>
|
||||||
@ -759,16 +760,17 @@ public class ThreadInfo {
|
|||||||
* <td>{@code java.lang.String}</td>
|
* <td>{@code java.lang.String}</td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td><a name="StackTrace">stackTrace</a></td>
|
* <td><a id="StackTrace">stackTrace</a></td>
|
||||||
* <td>{@code javax.management.openmbean.CompositeData[]}
|
* <td>{@code javax.management.openmbean.CompositeData[]}
|
||||||
* <p>
|
* <p>
|
||||||
* Each element is a {@code CompositeData} representing
|
* Each element is a {@code CompositeData} representing
|
||||||
* StackTraceElement containing the following attributes:
|
* StackTraceElement containing the following attributes:
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
* <table cellspacing=1 cellpadding=0 summary="The attributes and their types the given CompositeData contains">
|
* <table cellspacing=1 cellpadding=0>
|
||||||
|
* <caption style="display:none">The attributes and their types the given CompositeData contains</caption>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Attribute Name</th>
|
* <th style="text-align:left">Attribute Name</th>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>moduleName</td>
|
* <td>moduleName</td>
|
||||||
|
@ -32,7 +32,7 @@ Java virtual machine and other components in the Java runtime.
|
|||||||
It allows both local and remote
|
It allows both local and remote
|
||||||
monitoring and management of the running Java virtual machine.
|
monitoring and management of the running Java virtual machine.
|
||||||
|
|
||||||
<h4><a name="MXBean">Platform MXBean</a></h4>
|
<h3><a id="MXBean">Platform MXBean</a></h3>
|
||||||
<p>
|
<p>
|
||||||
A platform MXBean is a <i>managed bean</i> that
|
A platform MXBean is a <i>managed bean</i> that
|
||||||
conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
|
conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
|
||||||
@ -40,7 +40,7 @@ Instrumentation Specification and only uses a set of basic data types.
|
|||||||
Each platform MXBean is a {@link java.lang.management.PlatformManagedObject}
|
Each platform MXBean is a {@link java.lang.management.PlatformManagedObject}
|
||||||
with a unique
|
with a unique
|
||||||
{@linkplain java.lang.management.PlatformManagedObject#getObjectName name}.
|
{@linkplain java.lang.management.PlatformManagedObject#getObjectName name}.
|
||||||
<h4>ManagementFactory</h4>
|
<h3>ManagementFactory</h3>
|
||||||
|
|
||||||
<p>The {@link java.lang.management.ManagementFactory} class is the management
|
<p>The {@link java.lang.management.ManagementFactory} class is the management
|
||||||
factory class for the Java platform. This class provides a set of
|
factory class for the Java platform. This class provides a set of
|
||||||
@ -58,7 +58,7 @@ the specification of the management interface.
|
|||||||
This is a single MBeanServer that can be shared by different managed
|
This is a single MBeanServer that can be shared by different managed
|
||||||
components running within the same Java virtual machine.
|
components running within the same Java virtual machine.
|
||||||
|
|
||||||
<h4>Interoperability</h4>
|
<h3>Interoperability</h3>
|
||||||
|
|
||||||
<p>A management application and a platform MBeanServer of a running
|
<p>A management application and a platform MBeanServer of a running
|
||||||
virtual machine can interoperate
|
virtual machine can interoperate
|
||||||
@ -72,7 +72,7 @@ open type when being accessed via MBeanServer interface.
|
|||||||
See the <a href="../../../javax/management/MXBean.html#MXBean-spec">
|
See the <a href="../../../javax/management/MXBean.html#MXBean-spec">
|
||||||
MXBean</a> specification for details.
|
MXBean</a> specification for details.
|
||||||
|
|
||||||
<h4><a name="examples">Ways to Access MXBeans</a></h4>
|
<h3><a id="examples">Ways to Access MXBeans</a></h3>
|
||||||
|
|
||||||
<p>An application can monitor the instrumentation of the
|
<p>An application can monitor the instrumentation of the
|
||||||
Java virtual machine and the runtime in the following ways:
|
Java virtual machine and the runtime in the following ways:
|
||||||
@ -163,7 +163,7 @@ Java virtual machine and the runtime in the following ways:
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h4><a name="extension">Platform Extension</a></h4>
|
<h3><a id="extension">Platform Extension</a></h3>
|
||||||
|
|
||||||
<p>A Java virtual machine implementation may add its platform extension to
|
<p>A Java virtual machine implementation may add its platform extension to
|
||||||
the management interface by defining platform-dependent
|
the management interface by defining platform-dependent
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -96,7 +96,8 @@ import javax.management.openmbean.OpenType;
|
|||||||
* of the mapped Java type, called <em>opendata</em>(J) in the <a
|
* of the mapped Java type, called <em>opendata</em>(J) in the <a
|
||||||
* href="MXBean.html#mapping-rules">MXBean type mapping rules</a>.</p>
|
* href="MXBean.html#mapping-rules">MXBean type mapping rules</a>.</p>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="Descriptor Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">Descriptor Fields</caption>
|
||||||
*
|
*
|
||||||
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
|
||||||
*
|
*
|
||||||
@ -330,7 +331,8 @@ import javax.management.openmbean.OpenType;
|
|||||||
* interest outside Model MBeans, for example. But only Model MBeans have
|
* interest outside Model MBeans, for example. But only Model MBeans have
|
||||||
* a predefined behavior for these fields.</p>
|
* a predefined behavior for these fields.</p>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBean Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBean Fields</caption>
|
||||||
*
|
*
|
||||||
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -94,7 +94,8 @@ import java.lang.annotation.*;
|
|||||||
* <p>then the resulting {@code Descriptor} will contain the following
|
* <p>then the resulting {@code Descriptor} will contain the following
|
||||||
* fields:</p>
|
* fields:</p>
|
||||||
*
|
*
|
||||||
* <table border="2" summary="Descriptor Fields">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">Descriptor Fields</caption>
|
||||||
* <tr><th>Name</th><th>Value</th></tr>
|
* <tr><th>Name</th><th>Value</th></tr>
|
||||||
* <tr><td>units</td><td>"bytes"</td></tr>
|
* <tr><td>units</td><td>"bytes"</td></tr>
|
||||||
* <tr><td>descriptionResourceKey</td><td>"bytes.key"</td></tr>
|
* <tr><td>descriptionResourceKey</td><td>"bytes.key"</td></tr>
|
||||||
@ -143,7 +144,8 @@ import java.lang.annotation.*;
|
|||||||
* or an array of annotations. The value of the field is derived from
|
* or an array of annotations. The value of the field is derived from
|
||||||
* the value of the annotation element as follows:</p>
|
* the value of the annotation element as follows:</p>
|
||||||
*
|
*
|
||||||
* <table border="2" summary="Descriptor Field Types">
|
* <table border="1">
|
||||||
|
* <caption style="display:none">Descriptor Field Types</caption>
|
||||||
* <tr><th>Annotation element</th><th>Descriptor field</th></tr>
|
* <tr><th>Annotation element</th><th>Descriptor field</th></tr>
|
||||||
* <tr><td>Primitive value ({@code 5}, {@code false}, etc)</td>
|
* <tr><td>Primitive value ({@code 5}, {@code false}, etc)</td>
|
||||||
* <td>Wrapped value ({@code Integer.valueOf(5)},
|
* <td>Wrapped value ({@code Integer.valueOf(5)},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -133,7 +133,7 @@ import java.security.Permission;
|
|||||||
* any value (including another null value) but does not imply any
|
* any value (including another null value) but does not imply any
|
||||||
* other value.</p>
|
* other value.</p>
|
||||||
*
|
*
|
||||||
* <p><a name="action-list">The possible actions are these:</a></p>
|
* <p><a id="action-list">The possible actions are these:</a></p>
|
||||||
*
|
*
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>addNotificationListener</li>
|
* <li>addNotificationListener</li>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -93,7 +93,8 @@ import javax.management.openmbean.TabularType;
|
|||||||
Standard MBean concept. Here is how a managed object might be
|
Standard MBean concept. Here is how a managed object might be
|
||||||
represented as a Standard MBean, and as an MXBean:</p>
|
represented as a Standard MBean, and as an MXBean:</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -133,7 +134,8 @@ public interface MemoryPool<b>MXBean</b> {
|
|||||||
|
|
||||||
<p>So, we might define <code>MemoryUsage</code> like this:</p>
|
<p>So, we might define <code>MemoryUsage</code> like this:</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -195,7 +197,8 @@ public class MemoryUsage {
|
|||||||
<p>This becomes clearer if we compare what the clients of the two
|
<p>This becomes clearer if we compare what the clients of the two
|
||||||
models might look like:</p>
|
models might look like:</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -232,7 +235,8 @@ String name = (String)
|
|||||||
managed objects when you know the model beforehand, regardless
|
managed objects when you know the model beforehand, regardless
|
||||||
of whether you are using Standard MBeans or MXBeans:</p>
|
of whether you are using Standard MBeans or MXBeans:</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -265,7 +269,8 @@ long used = usage.getUsed();
|
|||||||
<p>Implementing the MemoryPool object works similarly for both
|
<p>Implementing the MemoryPool object works similarly for both
|
||||||
Standard MBeans and MXBeans.</p>
|
Standard MBeans and MXBeans.</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -292,7 +297,8 @@ public class MemoryPool
|
|||||||
<p>Registering the MBean in the MBean Server works in the same way
|
<p>Registering the MBean in the MBean Server works in the same way
|
||||||
in both cases:</p>
|
in both cases:</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Standard Bean vs. MXBean</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Standard MBean</th><th>MXBean</th>
|
<th>Standard MBean</th><th>MXBean</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -478,13 +484,14 @@ public class MemoryPool
|
|||||||
|
|
||||||
<p>The following table summarizes the type mapping rules.</p>
|
<p>The following table summarizes the type mapping rules.</p>
|
||||||
|
|
||||||
<table border="1" cellpadding="5" summary="Type Mapping Rules">
|
<table border="1" cellpadding="5">
|
||||||
|
<caption style="display:none">Type Mapping Rules</caption>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Java type <em>J</em></th>
|
<th>Java type <em>J</em></th>
|
||||||
<th><em>opentype(J)</em></th>
|
<th><em>opentype(J)</em></th>
|
||||||
<th><em>opendata(J)</em></th>
|
<th><em>opendata(J)</em></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody valign="top">
|
<tbody style="vertical-align:top">
|
||||||
<tr>
|
<tr>
|
||||||
<td>{@code int}, {@code boolean}, etc<br>
|
<td>{@code int}, {@code boolean}, etc<br>
|
||||||
(the 8 primitive Java types)</td>
|
(the 8 primitive Java types)</td>
|
||||||
|
@ -57,7 +57,8 @@ import javax.management.RuntimeOperationsException;
|
|||||||
* Note that when the Type in this table is Number, a String that is the decimal
|
* Note that when the Type in this table is Number, a String that is the decimal
|
||||||
* representation of a Long can also be used.</P>
|
* representation of a Long can also be used.</P>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBeanAttributeInfo Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBeanAttributeInfo Fields</caption>
|
||||||
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
||||||
* <tr><td>name</td><td>String</td>
|
* <tr><td>name</td><td>String</td>
|
||||||
* <td>Attribute name.</td></tr>
|
* <td>Attribute name.</td></tr>
|
||||||
|
@ -58,7 +58,8 @@ import javax.management.RuntimeOperationsException;
|
|||||||
* Note that when the Type in this table is Number, a String that is the decimal
|
* Note that when the Type in this table is Number, a String that is the decimal
|
||||||
* representation of a Long can also be used.</P>
|
* representation of a Long can also be used.</P>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBeanConstructorInfo Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBeanConstructorInfo Fields</caption>
|
||||||
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
||||||
* <tr><td>name</td><td>String</td>
|
* <tr><td>name</td><td>String</td>
|
||||||
* <td>Constructor name.</td></tr>
|
* <td>Constructor name.</td></tr>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -165,7 +165,8 @@ public interface ModelMBeanInfo
|
|||||||
* following. Note that when the Type in this table is Number, a String
|
* following. Note that when the Type in this table is Number, a String
|
||||||
* that is the decimal representation of a Long can also be used.</P>
|
* that is the decimal representation of a Long can also be used.</P>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBean Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBean Fields</caption>
|
||||||
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
||||||
* <tr><td>name</td><td>String</td>
|
* <tr><td>name</td><td>String</td>
|
||||||
* <td>MBean name.</td></tr>
|
* <td>MBean name.</td></tr>
|
||||||
|
@ -56,7 +56,8 @@ import javax.management.RuntimeOperationsException;
|
|||||||
* Note that when the Type in this table is Number, a String that is the decimal
|
* Note that when the Type in this table is Number, a String that is the decimal
|
||||||
* representation of a Long can also be used.</P>
|
* representation of a Long can also be used.</P>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBeanNotificationInfo Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBeanNotificationInfo Fields</caption>
|
||||||
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
||||||
* <tr><td>name</td><td>String</td>
|
* <tr><td>name</td><td>String</td>
|
||||||
* <td>Notification name.</td></tr>
|
* <td>Notification name.</td></tr>
|
||||||
|
@ -59,7 +59,8 @@ import javax.management.RuntimeOperationsException;
|
|||||||
* Note that when the Type in this table is Number, a String that is the decimal
|
* Note that when the Type in this table is Number, a String that is the decimal
|
||||||
* representation of a Long can also be used.</P>
|
* representation of a Long can also be used.</P>
|
||||||
*
|
*
|
||||||
* <table border="1" cellpadding="5" summary="ModelMBeanOperationInfo Fields">
|
* <table border="1" cellpadding="5">
|
||||||
|
* <caption style="display:none">ModelMBeanOperationInfo Fields</caption>
|
||||||
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
|
||||||
* <tr><td>name</td><td>String</td>
|
* <tr><td>name</td><td>String</td>
|
||||||
* <td>Operation name.</td></tr>
|
* <td>Operation name.</td></tr>
|
||||||
|
@ -110,7 +110,7 @@ mbs.invoke(mapName, "get", new Object[] {"key"}, new String[] {Object.class.getN
|
|||||||
// returns "value"
|
// returns "value"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h2><a name="spec">Package Specification</a></h2>
|
<h2><a id="spec">Package Specification</a></h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>See the <i>JMX 1.4 Specification</i>
|
<li>See the <i>JMX 1.4 Specification</i>
|
||||||
|
@ -77,7 +77,7 @@ questions.
|
|||||||
describes the items in the <code>CompositeData</code> instances
|
describes the items in the <code>CompositeData</code> instances
|
||||||
for the attribute.</p>
|
for the attribute.</p>
|
||||||
|
|
||||||
<h2><a name="constraints">Default values and constraints</a></h2>
|
<h2><a id="constraints">Default values and constraints</a></h2>
|
||||||
|
|
||||||
<p>In Open MBeans, attributes and parameters can have default values
|
<p>In Open MBeans, attributes and parameters can have default values
|
||||||
and/or constraints associated with them in the {@code
|
and/or constraints associated with them in the {@code
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -40,11 +40,12 @@ import javax.management.ObjectName;
|
|||||||
*
|
*
|
||||||
* <p>The notification type is one of the following:</p>
|
* <p>The notification type is one of the following:</p>
|
||||||
*
|
*
|
||||||
* <table summary="JMXConnectionNotification Types">
|
* <table>
|
||||||
|
* <caption style="display:none">JMXConnectionNotification Types</caption>
|
||||||
*
|
*
|
||||||
* <tr>
|
* <tr>
|
||||||
* <th align=left>Type</th>
|
* <th style="text-align:left">Type</th>
|
||||||
* <th align=left>Meaning</th>
|
* <th style="text-align:left">Meaning</th>
|
||||||
* </tr>
|
* </tr>
|
||||||
*
|
*
|
||||||
* <tr>
|
* <tr>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -41,7 +41,7 @@ import javax.xml.crypto.XMLCryptoContext;
|
|||||||
* (for example, you should not use the same <code>XMLSignContext</code>
|
* (for example, you should not use the same <code>XMLSignContext</code>
|
||||||
* instance to sign two different {@link XMLSignature} objects).
|
* instance to sign two different {@link XMLSignature} objects).
|
||||||
* <p>
|
* <p>
|
||||||
* <b><a name="SupportedProperties"></a>Supported Properties</b>
|
* <b><a id="SupportedProperties"></a>Supported Properties</b>
|
||||||
* <p>The following properties can be set using the
|
* <p>The following properties can be set using the
|
||||||
* {@link #setProperty setProperty} method.
|
* {@link #setProperty setProperty} method.
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -40,7 +40,7 @@ import javax.xml.crypto.XMLCryptoContext;
|
|||||||
* (for example, you should not use the same <code>XMLValidateContext</code>
|
* (for example, you should not use the same <code>XMLValidateContext</code>
|
||||||
* instance to validate two different {@link XMLSignature} objects).
|
* instance to validate two different {@link XMLSignature} objects).
|
||||||
* <p>
|
* <p>
|
||||||
* <b><a name="SupportedProperties"></a>Supported Properties</b>
|
* <b><a id="SupportedProperties"></a>Supported Properties</b>
|
||||||
* <p>The following properties can be set by an application using the
|
* <p>The following properties can be set by an application using the
|
||||||
* {@link #setProperty setProperty} method.
|
* {@link #setProperty setProperty} method.
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -291,8 +291,6 @@ sun/tools/jstat/jstatClassloadOutput1.sh 8173942 generic-
|
|||||||
|
|
||||||
sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java 8057732 generic-all
|
sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java 8057732 generic-all
|
||||||
|
|
||||||
demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java 8151899 generic-all
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# jdk_other
|
# jdk_other
|
||||||
|
@ -249,8 +249,7 @@ svc_tools = \
|
|||||||
sun/tools \
|
sun/tools \
|
||||||
-sun/tools/java \
|
-sun/tools/java \
|
||||||
-sun/tools/jrunscript \
|
-sun/tools/jrunscript \
|
||||||
sun/jvmstat \
|
sun/jvmstat
|
||||||
demo/jvmti
|
|
||||||
|
|
||||||
jdk_tools = \
|
jdk_tools = \
|
||||||
:core_tools \
|
:core_tools \
|
||||||
|
@ -1,188 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Sample target application for jvmti demos
|
|
||||||
*
|
|
||||||
* java Context [threadCount [iterationCount [sleepContention]]]
|
|
||||||
* Default: java Context 5 10 0
|
|
||||||
*
|
|
||||||
* threadCount Number of threads
|
|
||||||
* iterationCount Total turns taken for all threads
|
|
||||||
* sleepContention Time for main thread to sleep while holding lock
|
|
||||||
* (creates monitor contention on all other threads)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Used to sync up turns and keep track of who's turn it is */
|
|
||||||
final class TurnChecker {
|
|
||||||
int thread_index;
|
|
||||||
TurnChecker(int thread_index) {
|
|
||||||
this.thread_index = thread_index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Creates a bunch of threads that sequentially take turns */
|
|
||||||
public final class Context extends Thread {
|
|
||||||
/* Used to track threads */
|
|
||||||
private static long startTime;
|
|
||||||
private static TurnChecker turn = new TurnChecker(-1);
|
|
||||||
private static int total_turns_taken;
|
|
||||||
|
|
||||||
/* Used for each Context thread */
|
|
||||||
private final int thread_count;
|
|
||||||
private final int thread_index;
|
|
||||||
private final int thread_turns;
|
|
||||||
|
|
||||||
/* Main program */
|
|
||||||
public static void main(String[] argv) throws InterruptedException {
|
|
||||||
int default_thread_count = 5;
|
|
||||||
int default_thread_turns = 10;
|
|
||||||
int default_contention_sleep = 0;
|
|
||||||
int expected_turns_taken;
|
|
||||||
long sleepTime = 10L;
|
|
||||||
|
|
||||||
/* Override defaults */
|
|
||||||
if ( argv.length >= 1 ) {
|
|
||||||
default_thread_count = Integer.parseInt(argv[0]);
|
|
||||||
}
|
|
||||||
if ( argv.length >= 2 ) {
|
|
||||||
expected_turns_taken = Integer.parseInt(argv[1]);
|
|
||||||
default_thread_turns = expected_turns_taken/default_thread_count;
|
|
||||||
}
|
|
||||||
expected_turns_taken = default_thread_count*default_thread_turns;
|
|
||||||
if ( argv.length >= 3 ) {
|
|
||||||
default_contention_sleep = Integer.parseInt(argv[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Context started with "
|
|
||||||
+ default_thread_count + " threads and "
|
|
||||||
+ default_thread_turns + " turns per thread");
|
|
||||||
|
|
||||||
/* Get all threads running (they will block until we set turn) */
|
|
||||||
for (int i = 0; i < default_thread_count; i++) {
|
|
||||||
new Context(default_thread_count, i, default_thread_turns).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sleep to make sure thread_index 0 make it to the wait call */
|
|
||||||
System.out.println("Context sleeping, so threads will start wait");
|
|
||||||
Thread.yield();
|
|
||||||
Thread.sleep(sleepTime);
|
|
||||||
|
|
||||||
/* Save start time */
|
|
||||||
startTime = System.currentTimeMillis();
|
|
||||||
|
|
||||||
/* This triggers the starting of taking turns */
|
|
||||||
synchronized (turn) {
|
|
||||||
turn.thread_index = 0;
|
|
||||||
turn.notifyAll();
|
|
||||||
}
|
|
||||||
System.out.println("Context sleeping, so threads can run");
|
|
||||||
Thread.yield();
|
|
||||||
Thread.sleep(sleepTime);
|
|
||||||
|
|
||||||
/* Wait for threads to finish (after everyone has had their turns) */
|
|
||||||
while ( true ) {
|
|
||||||
boolean done;
|
|
||||||
done = false;
|
|
||||||
synchronized (turn) {
|
|
||||||
if ( total_turns_taken == expected_turns_taken ) {
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
/* Create some monitor contention by sleeping with lock */
|
|
||||||
if ( default_contention_sleep > 0 ) {
|
|
||||||
System.out.println("Context sleeping, to create contention");
|
|
||||||
Thread.yield();
|
|
||||||
Thread.sleep((long)default_contention_sleep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( done )
|
|
||||||
break;
|
|
||||||
System.out.println("Context sleeping, so threads will complete");
|
|
||||||
Thread.sleep(sleepTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
long endTime = System.currentTimeMillis();
|
|
||||||
long totalTime = endTime - startTime;
|
|
||||||
|
|
||||||
System.out.println("Total time (milliseconds): " + totalTime);
|
|
||||||
System.out.println("Milliseconds per thread: " +
|
|
||||||
((double)totalTime / (default_thread_count)));
|
|
||||||
|
|
||||||
System.out.println("Context completed");
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Thread object to run */
|
|
||||||
Context(int thread_count, int thread_index, int thread_turns) {
|
|
||||||
this.thread_count = thread_count;
|
|
||||||
this.thread_index = thread_index;
|
|
||||||
this.thread_turns = thread_turns;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Main for thread */
|
|
||||||
public void run() {
|
|
||||||
int next_thread_index = (thread_index + 1) % thread_count;
|
|
||||||
int turns_taken = 0;
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
/* Loop until we make sure we get all our turns */
|
|
||||||
for (int i = 0; i < thread_turns * thread_count; i++) {
|
|
||||||
synchronized (turn) {
|
|
||||||
/* Keep waiting for our turn */
|
|
||||||
while (turn.thread_index != thread_index)
|
|
||||||
turn.wait();
|
|
||||||
/* MY TURN! Each thread gets thread_turns */
|
|
||||||
total_turns_taken++;
|
|
||||||
turns_taken++;
|
|
||||||
System.out.println("Turn #" + total_turns_taken
|
|
||||||
+ " taken by thread " + thread_index
|
|
||||||
+ ", " + turns_taken
|
|
||||||
+ " turns taken by this thread");
|
|
||||||
/* Give next thread a turn */
|
|
||||||
turn.thread_index = next_thread_index;
|
|
||||||
turn.notifyAll();
|
|
||||||
}
|
|
||||||
/* If we've had all our turns, break out of this loop */
|
|
||||||
if (thread_turns == turns_taken) {
|
|
||||||
System.out.println("Loop end: thread got " + turns_taken
|
|
||||||
+ " turns, expected " + thread_turns);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (InterruptedException intEx) {
|
|
||||||
System.out.println("Got an InterruptedException:" + intEx);
|
|
||||||
/* skip */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure we got all our turns */
|
|
||||||
if ( thread_turns != turns_taken ) {
|
|
||||||
System.out.println("ERROR: thread got " + turns_taken
|
|
||||||
+ " turns, expected " + thread_turns);
|
|
||||||
System.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,211 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* DemoRun:
|
|
||||||
*
|
|
||||||
* Support classes for java jvmti demo tests
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper class to direct process output to a StringBuffer
|
|
||||||
*/
|
|
||||||
class MyInputStream implements Runnable {
|
|
||||||
private String name;
|
|
||||||
private BufferedInputStream in;
|
|
||||||
private StringBuffer buffer;
|
|
||||||
|
|
||||||
/* Create MyInputStream that saves all output to a StringBuffer */
|
|
||||||
MyInputStream(String name, InputStream in) {
|
|
||||||
this.name = name;
|
|
||||||
this.in = new BufferedInputStream(in);
|
|
||||||
buffer = new StringBuffer(4096);
|
|
||||||
Thread thr = new Thread(this);
|
|
||||||
thr.setDaemon(true);
|
|
||||||
thr.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dump the buffer */
|
|
||||||
void dump(PrintStream x) {
|
|
||||||
String str = buffer.toString();
|
|
||||||
x.println("<beginning of " + name + " buffer>");
|
|
||||||
x.println(str);
|
|
||||||
x.println("<end of buffer>");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check to see if a pattern is inside the output. */
|
|
||||||
boolean contains(String pattern) {
|
|
||||||
String str = buffer.toString();
|
|
||||||
return str.contains(pattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Runs as a separate thread capturing all output in a StringBuffer */
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
byte b[] = new byte[100];
|
|
||||||
for (;;) {
|
|
||||||
int n = in.read(b);
|
|
||||||
String str;
|
|
||||||
if (n < 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
str = new String(b, 0, n);
|
|
||||||
buffer.append(str);
|
|
||||||
System.out.print(str);
|
|
||||||
}
|
|
||||||
} catch (IOException ioe) { /* skip */ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main JVMTI Demo Run class.
|
|
||||||
*/
|
|
||||||
public class DemoRun {
|
|
||||||
|
|
||||||
private String demo_name;
|
|
||||||
private String demo_options;
|
|
||||||
private MyInputStream output;
|
|
||||||
private MyInputStream error;
|
|
||||||
|
|
||||||
/* Create a Demo run process */
|
|
||||||
public DemoRun(String name, String options)
|
|
||||||
{
|
|
||||||
demo_name = name;
|
|
||||||
demo_options = options;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Execute a process with an -agentpath or -agentlib command option
|
|
||||||
*/
|
|
||||||
public void runit(String class_name)
|
|
||||||
{
|
|
||||||
runit(class_name, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Execute a process with an -agentpath or -agentlib command option
|
|
||||||
* plus any set of other java options.
|
|
||||||
*/
|
|
||||||
public void runit(String class_name, String vm_options[])
|
|
||||||
{
|
|
||||||
String sdk_home = System.getProperty("java.home");
|
|
||||||
String cdir = System.getProperty("test.classes", ".");
|
|
||||||
String os_arch = System.getProperty("os.arch");
|
|
||||||
String os_name = System.getProperty("os.name");
|
|
||||||
String libprefix = os_name.contains("Windows")?"":"lib";
|
|
||||||
String libsuffix = os_name.contains("Windows")?".dll":
|
|
||||||
os_name.contains("OS X")?".dylib":".so";
|
|
||||||
String java = sdk_home
|
|
||||||
+ File.separator + "bin"
|
|
||||||
+ File.separator + "java";
|
|
||||||
/* Array of strings to be passed in for exec:
|
|
||||||
* 1. java
|
|
||||||
* 2. -Dtest.classes=.
|
|
||||||
* 3. -Xcheck:jni (Just because it finds bugs)
|
|
||||||
* 4. -Xverify:all (Make sure verification is on full blast)
|
|
||||||
* 5. -agent
|
|
||||||
* vm_options
|
|
||||||
* 6+i. classname
|
|
||||||
*/
|
|
||||||
int nvm_options = 0;
|
|
||||||
if ( vm_options != null ) nvm_options = vm_options.length;
|
|
||||||
String cmd[] = new String[1 + 7 + nvm_options];
|
|
||||||
String cmdLine;
|
|
||||||
int exitStatus;
|
|
||||||
int i,j;
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
cmdLine = "";
|
|
||||||
cmdLine += (cmd[i++] = java);
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = "-cp");
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = cdir);
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = "-Dtest.classes=" + cdir);
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = "-Xcheck:jni");
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = "-Xverify:all");
|
|
||||||
String libname = sdk_home
|
|
||||||
+ File.separator + "demo"
|
|
||||||
+ File.separator + "jvmti"
|
|
||||||
+ File.separator + demo_name
|
|
||||||
+ File.separator + "lib"
|
|
||||||
+ File.separator + libprefix + demo_name + libsuffix;
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = "-agentpath:" + libname
|
|
||||||
+ (demo_options.equals("") ? "" : ("=" + demo_options)));
|
|
||||||
/* Add any special VM options */
|
|
||||||
for ( j = 0; j < nvm_options; j++ ) {
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = vm_options[j]);
|
|
||||||
}
|
|
||||||
/* Add classname */
|
|
||||||
cmdLine += " ";
|
|
||||||
cmdLine += (cmd[i++] = class_name);
|
|
||||||
|
|
||||||
/* Begin process */
|
|
||||||
Process p;
|
|
||||||
|
|
||||||
System.out.println("Starting: " + cmdLine);
|
|
||||||
try {
|
|
||||||
p = Runtime.getRuntime().exec(cmd);
|
|
||||||
} catch ( IOException e ) {
|
|
||||||
throw new RuntimeException("Test failed - exec got IO exception");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Save process output in StringBuffers */
|
|
||||||
output = new MyInputStream("Input Stream", p.getInputStream());
|
|
||||||
error = new MyInputStream("Error Stream", p.getErrorStream());
|
|
||||||
|
|
||||||
/* Wait for process to complete, and if exit code is non-zero we fail */
|
|
||||||
try {
|
|
||||||
exitStatus = p.waitFor();
|
|
||||||
if ( exitStatus != 0) {
|
|
||||||
System.out.println("Exit code is " + exitStatus);
|
|
||||||
error.dump(System.out);
|
|
||||||
output.dump(System.out);
|
|
||||||
throw new RuntimeException("Test failed - " +
|
|
||||||
"exit return code non-zero " +
|
|
||||||
"(exitStatus==" + exitStatus + ")");
|
|
||||||
}
|
|
||||||
} catch ( InterruptedException e ) {
|
|
||||||
throw new RuntimeException("Test failed - process interrupted");
|
|
||||||
}
|
|
||||||
System.out.println("Completed: " + cmdLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Does the pattern appear in the output of this process */
|
|
||||||
public boolean output_contains(String pattern)
|
|
||||||
{
|
|
||||||
return output.contains(pattern) || error.contains(pattern);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Sample target application
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Animal {
|
|
||||||
int category;
|
|
||||||
int age;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Pet extends Animal {
|
|
||||||
String owner;
|
|
||||||
String name;
|
|
||||||
String vet;
|
|
||||||
String records;
|
|
||||||
String address;
|
|
||||||
Pet(String name) { this.name = name; }
|
|
||||||
}
|
|
||||||
|
|
||||||
class Dog extends Pet {
|
|
||||||
int breed;
|
|
||||||
int barks;
|
|
||||||
Dog(String name) { super(name); }
|
|
||||||
}
|
|
||||||
|
|
||||||
class Cat extends Pet {
|
|
||||||
int breed;
|
|
||||||
int claws;
|
|
||||||
Cat(String name) { super(name); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class HeapUser {
|
|
||||||
private static Dog dogs[];
|
|
||||||
private static Cat cats[];
|
|
||||||
public static void main(String args[]) {
|
|
||||||
System.out.println("HeapUser start, 101 dogs, 1000 cats");
|
|
||||||
dogs = new Dog[101];
|
|
||||||
for(int i=0; i<101; i++) {
|
|
||||||
dogs[i] = new Dog("fido " + i);
|
|
||||||
}
|
|
||||||
cats = new Cat[1000];
|
|
||||||
for(int i=0; i<1000; i++) {
|
|
||||||
cats[i] = new Cat("feefee " + i);
|
|
||||||
}
|
|
||||||
System.out.println("HeapUser end");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Sample target application for jvmti demos
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Hello {
|
|
||||||
public static void main(String args[]) {
|
|
||||||
System.out.println("Hello");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 6580131
|
|
||||||
* @summary Test jvmti demo compiledMethodLoad
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java ../Hello.java
|
|
||||||
* @build CompiledMethodLoadTest
|
|
||||||
* @run main CompiledMethodLoadTest Hello
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class CompiledMethodLoadTest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI compiledMethodLoad agent (no options) */
|
|
||||||
demo = new DemoRun("compiledMethodLoad", "" /* options to compiledMethodLoad */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Sample target application for gctest demo
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class BigHello {
|
|
||||||
private final static int NLOOPS = 20000;
|
|
||||||
private static Object garbage[];
|
|
||||||
public static void main(String args[]) {
|
|
||||||
long count = 0;
|
|
||||||
System.out.println("Big Hello start");
|
|
||||||
for(int i=1; i<=NLOOPS; i++) {
|
|
||||||
count += i;
|
|
||||||
garbage = new Object[i];
|
|
||||||
garbage[0] = new Object();
|
|
||||||
}
|
|
||||||
System.out.println("Allocated " + count +
|
|
||||||
" array elements, and " + NLOOPS +
|
|
||||||
" arrays and Objects.");
|
|
||||||
System.out.println("Big Hello end");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 5027764
|
|
||||||
* @summary Test jvmti demo gctest
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java
|
|
||||||
* @build BigHello Gctest
|
|
||||||
* @run main Gctest BigHello
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Gctest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI gctest agent (no options) */
|
|
||||||
demo = new DemoRun("gctest", "" /* options to gctest */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 5050116 6299047
|
|
||||||
* @summary Test jvmti demo heapTracker
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java
|
|
||||||
* @compile ../HeapUser.java
|
|
||||||
* @build HeapTrackerTest
|
|
||||||
* @run main HeapTrackerTest HeapUser
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class HeapTrackerTest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI heapTracker agent (no options) */
|
|
||||||
demo = new DemoRun("heapTracker", "" /* options to heapTracker */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 5033539
|
|
||||||
* @summary Test jvmti demo heapViewer
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java
|
|
||||||
* @compile ../HeapUser.java
|
|
||||||
* @build HeapViewerTest
|
|
||||||
* @run main HeapViewerTest HeapUser
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class HeapViewerTest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI heapViewer agent (no options) */
|
|
||||||
demo = new DemoRun("heapViewer", "" /* options to heapViewer */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 6377205
|
|
||||||
* @summary Test jvmti demo minst
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java
|
|
||||||
* @compile MinstExample.java
|
|
||||||
* @build MinstTest
|
|
||||||
* @run main MinstTest MinstExample
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class MinstTest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI minst agent (no options) */
|
|
||||||
demo = new DemoRun("minst", "exclude=java/*,exclude=javax/*,exclude=com/*,exclude=jdk/*,exclude=sun/*" /* options to minst */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 5039613
|
|
||||||
* @summary Test jvmti demo versionCheck
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java ../Hello.java
|
|
||||||
* @build FailsWhenJvmtiVersionDiffers
|
|
||||||
* @run main FailsWhenJvmtiVersionDiffers Hello
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class FailsWhenJvmtiVersionDiffers {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI versionCheck agent (no options) */
|
|
||||||
demo = new DemoRun("versionCheck", "" /* options to versionCheck */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
System.out.println(
|
|
||||||
"NOTE: The jmvti.h file doesn't match the JVMTI in the VM.\n"
|
|
||||||
+" This may or may not be a serious issue.\n"
|
|
||||||
+" Check the jtr file for details.\n"
|
|
||||||
+" Call your local serviceability representative for help."
|
|
||||||
);
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* @test
|
|
||||||
* @bug 5027764
|
|
||||||
* @summary Test jvmti demo waiters
|
|
||||||
*
|
|
||||||
* @compile ../DemoRun.java
|
|
||||||
* @compile ../Context.java
|
|
||||||
* @build WaitersTest
|
|
||||||
* @run main WaitersTest Context
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class WaitersTest {
|
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
|
||||||
DemoRun demo;
|
|
||||||
|
|
||||||
/* Run demo that uses JVMTI waiters agent (no options) */
|
|
||||||
demo = new DemoRun("waiters", "" /* options to waiters */ );
|
|
||||||
demo.runit(args[0]);
|
|
||||||
|
|
||||||
/* Make sure patterns in output look ok */
|
|
||||||
if (demo.output_contains("ERROR")) {
|
|
||||||
throw new RuntimeException("Test failed - ERROR seen in output");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Must be a pass. */
|
|
||||||
System.out.println("Test passed - cleanly terminated");
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,7 +24,6 @@
|
|||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 6402006 7030573 8011136
|
* @bug 6402006 7030573 8011136
|
||||||
* @key intermittent
|
|
||||||
* @summary Test if available returns correct value when reading
|
* @summary Test if available returns correct value when reading
|
||||||
* a large file.
|
* a large file.
|
||||||
* @run main/timeout=300 LargeFileAvailable
|
* @run main/timeout=300 LargeFileAvailable
|
||||||
|
@ -286,7 +286,11 @@ public class FieldSetAccessibleTest {
|
|||||||
* Filter deployment modules
|
* Filter deployment modules
|
||||||
*/
|
*/
|
||||||
static Set<String> systemModules() {
|
static Set<String> systemModules() {
|
||||||
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws");
|
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
|
||||||
|
// All JVMCI packages other than jdk.vm.ci.services are dynamically
|
||||||
|
// exported to jdk.internal.vm.compiler and jdk.aot
|
||||||
|
"jdk.internal.vm.compiler", "jdk.aot"
|
||||||
|
);
|
||||||
return ModuleFinder.ofSystem().findAll().stream()
|
return ModuleFinder.ofSystem().findAll().stream()
|
||||||
.map(mref -> mref.descriptor().name())
|
.map(mref -> mref.descriptor().name())
|
||||||
.filter(mn -> !mods.contains(mn))
|
.filter(mn -> !mods.contains(mn))
|
||||||
|
96
jdk/test/java/lang/invoke/8177146/TestMethodHandleBind.java
Normal file
96
jdk/test/java/lang/invoke/8177146/TestMethodHandleBind.java
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @test
|
||||||
|
* @bug 8177146
|
||||||
|
* @run testng/othervm TestMethodHandleBind
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.lang.invoke.MethodHandle;
|
||||||
|
import java.lang.invoke.MethodType;
|
||||||
|
|
||||||
|
import static java.lang.invoke.MethodHandles.lookup;
|
||||||
|
|
||||||
|
import static org.testng.Assert.*;
|
||||||
|
|
||||||
|
public class TestMethodHandleBind extends pkg.A {
|
||||||
|
static class B extends TestMethodHandleBind {}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInstanceOfCallerClass() throws Throwable {
|
||||||
|
MethodHandle bound = lookup().bind(new TestMethodHandleBind() , "m1", MethodType.methodType(String.class));
|
||||||
|
String x = (String)bound.invoke();
|
||||||
|
assertEquals(x, this.getClass().getSimpleName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInstanceOfCallerSubclass() throws Throwable {
|
||||||
|
MethodHandle bound = lookup().bind(new B() , "m1", MethodType.methodType(String.class));
|
||||||
|
// MethodHandle bound = lookup().findVirtual(B.class, "m1", MethodType.methodType(String.class)).bindTo(new B());
|
||||||
|
String x = (String)bound.invoke();
|
||||||
|
assertEquals(x, "B");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInstanceOfReceiverClass() throws Throwable {
|
||||||
|
try {
|
||||||
|
MethodHandle bound = lookup().bind(new pkg.A() , "m1", MethodType.methodType(String.class));
|
||||||
|
bound.invoke();
|
||||||
|
fail("IllegalAccessException expected");
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPublicMethod() throws Throwable {
|
||||||
|
MethodHandle bound = lookup().bind(new pkg.A() , "m2", MethodType.methodType(String.class));
|
||||||
|
String x = (String)bound.invoke();
|
||||||
|
assertEquals(x, "A");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPublicMethod2() throws Throwable {
|
||||||
|
MethodHandle bound = lookup().bind(new TestMethodHandleBind(), "m2", MethodType.methodType(String.class));
|
||||||
|
String x = (String)bound.invoke();
|
||||||
|
assertEquals(x, this.getClass().getSimpleName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInstanceOfCallerClassVarargs() throws Throwable {
|
||||||
|
MethodHandle bound = lookup().bind(new TestMethodHandleBind() , "m3", MethodType.methodType(String.class, String[].class));
|
||||||
|
String x = (String)bound.invoke("a", "b", "c");
|
||||||
|
assertEquals(x, this.getClass().getSimpleName() + "abc");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInstanceOfReceiverClassVarargs() throws Throwable {
|
||||||
|
try {
|
||||||
|
MethodHandle bound = lookup().bind(new pkg.A(), "m3", MethodType.methodType(String.class, String[].class));
|
||||||
|
bound.invoke();
|
||||||
|
fail("IllegalAccessException expected");
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -20,20 +20,21 @@
|
|||||||
* or visit www.oracle.com if you need additional information or have any
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
package pkg;
|
||||||
|
|
||||||
|
public class A {
|
||||||
/* MinstExample:
|
protected String m1() {
|
||||||
*
|
return this.getClass().getSimpleName();
|
||||||
*/
|
|
||||||
|
|
||||||
public class MinstExample {
|
|
||||||
private static int called = 0;
|
|
||||||
private static void foobar() {
|
|
||||||
called++;
|
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("MinstExample started");
|
public String m2() {
|
||||||
for(int i=0; i<200; i++) foobar();
|
return this.getClass().getSimpleName();
|
||||||
System.out.println("MinstExample ended");
|
}
|
||||||
|
|
||||||
|
protected String m3(String... args) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String s : args)
|
||||||
|
sb.append(s);
|
||||||
|
return this.getClass().getSimpleName() + sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,7 +24,6 @@
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 8137121 8137230
|
* @bug 8137121 8137230
|
||||||
* @key intermittent
|
|
||||||
* @summary (fc) Infinite loop FileChannel.truncate
|
* @summary (fc) Infinite loop FileChannel.truncate
|
||||||
* @library /lib/testlibrary
|
* @library /lib/testlibrary
|
||||||
* @build jdk.testlibrary.Utils
|
* @build jdk.testlibrary.Utils
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
/* @test
|
/* @test
|
||||||
* @bug 4434723 4482726 4559072 4795550 5081340 5103988 6984545
|
* @bug 4434723 4482726 4559072 4795550 5081340 5103988 6984545
|
||||||
* @key intermittent
|
|
||||||
* @summary Test FileChannel.transferFrom and transferTo (use -Dseed=X to set PRNG seed)
|
* @summary Test FileChannel.transferFrom and transferTo (use -Dseed=X to set PRNG seed)
|
||||||
* @library ..
|
* @library ..
|
||||||
* @library /lib/testlibrary/
|
* @library /lib/testlibrary/
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* @test
|
/* @test
|
||||||
* @key intermittent
|
|
||||||
* @summary Comprehensive test for FileChannel.transfer{From,To}
|
* @summary Comprehensive test for FileChannel.transfer{From,To}
|
||||||
* @bug 4708120
|
* @bug 4708120
|
||||||
* @author Mark Reinhold
|
* @author Mark Reinhold
|
||||||
|
Loading…
Reference in New Issue
Block a user