< prev index next >

src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java

Print this page

 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 
 26 package jdk.internal.access;
 27 
 28 import java.io.InputStream;
 29 import java.lang.annotation.Annotation;
 30 import java.lang.invoke.MethodHandle;
 31 import java.lang.invoke.MethodType;
 32 import java.lang.module.ModuleDescriptor;

 33 import java.lang.reflect.Executable;
 34 import java.lang.reflect.Method;
 35 import java.net.URI;
 36 import java.nio.charset.CharacterCodingException;
 37 import java.nio.charset.Charset;
 38 import java.security.AccessControlContext;
 39 import java.security.ProtectionDomain;
 40 import java.util.List;
 41 import java.util.Map;
 42 import java.util.Set;
 43 import java.util.concurrent.Callable;
 44 import java.util.concurrent.ConcurrentHashMap;
 45 import java.util.concurrent.RejectedExecutionException;
 46 import java.util.stream.Stream;
 47 
 48 import jdk.internal.javac.PreviewFeature;
 49 import jdk.internal.misc.CarrierThreadLocal;
 50 import jdk.internal.module.ServicesCatalog;
 51 import jdk.internal.reflect.ConstantPool;
 52 import jdk.internal.vm.Continuation;

552      * @param nanos the maximum number of nanoseconds to wait
553      * @throws WrongThreadException if the current thread is not a virtual thread
554      */
555     void parkVirtualThread(long nanos);
556 
557     /**
558      * Re-enables a virtual thread for scheduling. If the thread was parked then
559      * it will be unblocked, otherwise its next attempt to park will not block
560      * @param thread the virtual thread to unpark
561      * @throws IllegalArgumentException if the thread is not a virtual thread
562      * @throws RejectedExecutionException if the scheduler cannot accept a task
563      */
564     void unparkVirtualThread(Thread thread);
565 
566     /**
567      * Creates a new StackWalker
568      */
569     StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
570                                        ContinuationScope contScope,
571                                        Continuation continuation);







































572     /**
573      * Returns '<loader-name>' @<id> if classloader has a name
574      * explicitly set otherwise <qualified-class-name> @<id>
575      */
576     String getLoaderNameID(ClassLoader loader);
577 }

 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any
 23  * questions.
 24  */
 25 
 26 package jdk.internal.access;
 27 
 28 import java.io.InputStream;
 29 import java.lang.annotation.Annotation;
 30 import java.lang.invoke.MethodHandle;
 31 import java.lang.invoke.MethodType;
 32 import java.lang.module.ModuleDescriptor;
 33 import java.lang.reflect.ClassFileFormatVersion;
 34 import java.lang.reflect.Executable;
 35 import java.lang.reflect.Method;
 36 import java.net.URI;
 37 import java.nio.charset.CharacterCodingException;
 38 import java.nio.charset.Charset;
 39 import java.security.AccessControlContext;
 40 import java.security.ProtectionDomain;
 41 import java.util.List;
 42 import java.util.Map;
 43 import java.util.Set;
 44 import java.util.concurrent.Callable;
 45 import java.util.concurrent.ConcurrentHashMap;
 46 import java.util.concurrent.RejectedExecutionException;
 47 import java.util.stream.Stream;
 48 
 49 import jdk.internal.javac.PreviewFeature;
 50 import jdk.internal.misc.CarrierThreadLocal;
 51 import jdk.internal.module.ServicesCatalog;
 52 import jdk.internal.reflect.ConstantPool;
 53 import jdk.internal.vm.Continuation;

553      * @param nanos the maximum number of nanoseconds to wait
554      * @throws WrongThreadException if the current thread is not a virtual thread
555      */
556     void parkVirtualThread(long nanos);
557 
558     /**
559      * Re-enables a virtual thread for scheduling. If the thread was parked then
560      * it will be unblocked, otherwise its next attempt to park will not block
561      * @param thread the virtual thread to unpark
562      * @throws IllegalArgumentException if the thread is not a virtual thread
563      * @throws RejectedExecutionException if the scheduler cannot accept a task
564      */
565     void unparkVirtualThread(Thread thread);
566 
567     /**
568      * Creates a new StackWalker
569      */
570     StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
571                                        ContinuationScope contScope,
572                                        Continuation continuation);
573 
574     /**
575      * {@return the primary class for a primitive class}
576      *
577      * @param klass a class
578      */
579     Class<?> asPrimaryType(Class<?> klass);
580 
581     /**
582      * {@return the value type of a primitive class}
583      *
584      * @param klass a class
585      */
586     Class<?> asValueType(Class<?> klass);
587 
588     /**
589      * {@return true if the class is the primary type of a primitive class}
590      *
591      * @param klass a class
592      */
593     boolean isPrimaryType(Class<?> klass);
594 
595     /**
596      * {@return true if the class is the primary type of a primitive class}
597      *
598      * @param klass a class
599      */
600     boolean isPrimitiveValueType(Class<?> klass);
601 
602     /**
603      * Returns {@code true} if this class is a primitive class.
604      */
605     boolean isPrimitiveClass(Class<?> klass);
606 
607     /**
608      * Returns the class file format version of the class.
609      */
610     int classFileFormatVersion(Class<?> klass);
611 
612     /**
613      * Returns '<loader-name>' @<id> if classloader has a name
614      * explicitly set otherwise <qualified-class-name> @<id>
615      */
616     String getLoaderNameID(ClassLoader loader);
617 }
< prev index next >