< prev index next >

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

Print this page

 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.foreign.MemorySegment;
 31 import java.lang.invoke.MethodHandle;
 32 import java.lang.invoke.MethodType;
 33 import java.lang.module.ModuleDescriptor;

 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.misc.CarrierThreadLocal;
 50 import jdk.internal.module.ServicesCatalog;
 51 import jdk.internal.reflect.ConstantPool;
 52 import jdk.internal.vm.Continuation;
 53 import jdk.internal.vm.ContinuationScope;

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






574     /**
575      * Returns '<loader-name>' @<id> if classloader has a name
576      * explicitly set otherwise <qualified-class-name> @<id>
577      */
578     String getLoaderNameID(ClassLoader loader);
579 
580     /**
581      * Copy the string bytes to an existing segment, avoiding intermediate copies.
582      */
583     void copyToSegmentRaw(String string, MemorySegment segment, long offset);
584 
585     /**
586      * Are the string bytes compatible with the given charset?
587      */
588     boolean bytesCompatible(String string, Charset charset);
589 }

 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.foreign.MemorySegment;
 31 import java.lang.invoke.MethodHandle;
 32 import java.lang.invoke.MethodType;
 33 import java.lang.module.ModuleDescriptor;
 34 import java.lang.reflect.ClassFileFormatVersion;
 35 import java.lang.reflect.Executable;
 36 import java.lang.reflect.Method;
 37 import java.net.URI;
 38 import java.nio.charset.CharacterCodingException;
 39 import java.nio.charset.Charset;
 40 import java.security.AccessControlContext;
 41 import java.security.ProtectionDomain;
 42 import java.util.List;
 43 import java.util.Map;
 44 import java.util.Set;
 45 import java.util.concurrent.Callable;
 46 import java.util.concurrent.ConcurrentHashMap;
 47 import java.util.concurrent.RejectedExecutionException;
 48 import java.util.stream.Stream;
 49 
 50 import jdk.internal.misc.CarrierThreadLocal;
 51 import jdk.internal.module.ServicesCatalog;
 52 import jdk.internal.reflect.ConstantPool;
 53 import jdk.internal.vm.Continuation;
 54 import jdk.internal.vm.ContinuationScope;

555      * @param nanos the maximum number of nanoseconds to wait
556      * @throws WrongThreadException if the current thread is not a virtual thread
557      */
558     void parkVirtualThread(long nanos);
559 
560     /**
561      * Re-enables a virtual thread for scheduling. If the thread was parked then
562      * it will be unblocked, otherwise its next attempt to park will not block
563      * @param thread the virtual thread to unpark
564      * @throws IllegalArgumentException if the thread is not a virtual thread
565      * @throws RejectedExecutionException if the scheduler cannot accept a task
566      */
567     void unparkVirtualThread(Thread thread);
568 
569     /**
570      * Creates a new StackWalker
571      */
572     StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
573                                        ContinuationScope contScope,
574                                        Continuation continuation);
575 
576     /**
577      * Returns the class file format version of the class.
578      */
579     int classFileFormatVersion(Class<?> klass);
580 
581     /**
582      * Returns '<loader-name>' @<id> if classloader has a name
583      * explicitly set otherwise <qualified-class-name> @<id>
584      */
585     String getLoaderNameID(ClassLoader loader);
586 
587     /**
588      * Copy the string bytes to an existing segment, avoiding intermediate copies.
589      */
590     void copyToSegmentRaw(String string, MemorySegment segment, long offset);
591 
592     /**
593      * Are the string bytes compatible with the given charset?
594      */
595     boolean bytesCompatible(String string, Charset charset);
596 }
< prev index next >