< prev index next >

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

Print this page

 23  * questions.
 24  */
 25 
 26 package jdk.internal.access;
 27 
 28 import java.lang.annotation.Annotation;
 29 import java.lang.invoke.MethodHandle;
 30 import java.lang.invoke.MethodHandles;
 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.ConcurrentHashMap;

 44 import java.util.stream.Stream;
 45 
 46 import jdk.internal.module.ServicesCatalog;
 47 import jdk.internal.reflect.ConstantPool;



 48 import sun.reflect.annotation.AnnotationType;
 49 import sun.nio.ch.Interruptible;
 50 
 51 public interface JavaLangAccess {
 52 
 53     /**
 54      * Returns the list of {@code Method} objects for the declared public
 55      * methods of this class or interface that have the specified method name
 56      * and parameter types.
 57      */
 58     List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
 59 
 60     /**
 61      * Return the constant pool for a class.
 62      */
 63     ConstantPool getConstantPool(Class<?> klass);
 64 
 65     /**
 66      * Compare-And-Set the AnnotationType instance corresponding to this class.
 67      * (This method only applies to annotation types.)

393 
394     /**
395      * Join strings
396      */
397     String join(String prefix, String suffix, String delimiter, String[] elements, int size);
398 
399     /*
400      * Get the class data associated with the given class.
401      * @param c the class
402      * @see java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)
403      */
404     Object classData(Class<?> c);
405 
406     long findNative(ClassLoader loader, String entry);
407 
408     /**
409      * Direct access to Shutdown.exit to avoid security manager checks
410      * @param statusCode the status code
411      */
412     void exit(int statusCode);






























































































413 }

 23  * questions.
 24  */
 25 
 26 package jdk.internal.access;
 27 
 28 import java.lang.annotation.Annotation;
 29 import java.lang.invoke.MethodHandle;
 30 import java.lang.invoke.MethodHandles;
 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.module.ServicesCatalog;
 49 import jdk.internal.reflect.ConstantPool;
 50 import jdk.internal.vm.Continuation;
 51 import jdk.internal.vm.ContinuationScope;
 52 import jdk.internal.vm.ThreadContainer;
 53 import sun.reflect.annotation.AnnotationType;
 54 import sun.nio.ch.Interruptible;
 55 
 56 public interface JavaLangAccess {
 57 
 58     /**
 59      * Returns the list of {@code Method} objects for the declared public
 60      * methods of this class or interface that have the specified method name
 61      * and parameter types.
 62      */
 63     List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
 64 
 65     /**
 66      * Return the constant pool for a class.
 67      */
 68     ConstantPool getConstantPool(Class<?> klass);
 69 
 70     /**
 71      * Compare-And-Set the AnnotationType instance corresponding to this class.
 72      * (This method only applies to annotation types.)

398 
399     /**
400      * Join strings
401      */
402     String join(String prefix, String suffix, String delimiter, String[] elements, int size);
403 
404     /*
405      * Get the class data associated with the given class.
406      * @param c the class
407      * @see java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)
408      */
409     Object classData(Class<?> c);
410 
411     long findNative(ClassLoader loader, String entry);
412 
413     /**
414      * Direct access to Shutdown.exit to avoid security manager checks
415      * @param statusCode the status code
416      */
417     void exit(int statusCode);
418     /**
419      * Returns an array of all platform threads.
420      */
421     Thread[] getAllThreads();
422 
423     /**
424      * Returns the ThreadContainer for a thread, may be null.
425      */
426     ThreadContainer threadContainer(Thread thread);
427 
428     /**
429      * Starts a thread in the given ThreadContainer.
430      */
431     void start(Thread thread, ThreadContainer container);
432 
433     /**
434      * Returns the thread container at the head/top of the stack.
435      */
436     ThreadContainer headThreadContainer(Thread thread);
437 
438     /**
439      * Pushes a thread container to the top of the current thread's stack.
440      * @return the current thread's scope local bindings
441      */
442     Object pushThreadContainer(ThreadContainer container);
443 
444     /**
445      * Pops a thread container from the current thread's stack.
446      */
447     void popThreadContainer(ThreadContainer container);
448 
449     /**
450      * Returns a reference to the Thread object for the currently executing
451      * carrier thread.
452      */
453     Thread currentCarrierThread();
454 
455     /**
456      * Executes the given value returning task on the current carrier thread.
457      */
458     <V> V executeOnCarrierThread(Callable<V> task) throws Exception;
459 
460     /**
461      * Returns the value of the current carrier thread's copy of a thread-local.
462      */
463     <T> T getCarrierThreadLocal(ThreadLocal<T> local);
464 
465     /**
466      * Sets the value of the current carrier thread's copy of a thread-local.
467      */
468     <T> void setCarrierThreadLocal(ThreadLocal<T> local, T value);
469 
470     /**
471      * Returns the current thread's scope locals cache
472      */
473     Object[] scopeLocalCache();
474 
475     /**
476      * Sets the current thread's scope locals cache
477      */
478     void setScopeLocalCache(Object[] cache);
479 
480     /**
481      * Returns the innermost mounted continuation
482      */
483      Continuation getContinuation(Thread thread);
484 
485     /**
486      * Sets the innermost mounted continuation
487      */
488     void setContinuation(Thread thread, Continuation continuation);
489 
490     /**
491      * Parks the current virtual thread.
492      */
493     void parkVirtualThread();
494 
495     /**
496      * Parks the current virtual thread for up to the given waiting time.
497      */
498     void parkVirtualThread(long nanos);
499 
500     /**
501      * Unparks a virtual thread.
502      * @throws RejectedExecutionException if the scheduler cannot accept a task
503      */
504     void unparkVirtualThread(Thread thread);
505 
506     /**
507      * Creates a new StackWalker
508      */
509     StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
510                                        ContinuationScope contScope,
511                                        Continuation continuation);
512 }
< prev index next >