< 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.StackableScope;
 53 import jdk.internal.vm.ThreadContainer;
 54 import sun.reflect.annotation.AnnotationType;
 55 import sun.nio.ch.Interruptible;
 56 
 57 public interface JavaLangAccess {
 58 
 59     /**
 60      * Returns the list of {@code Method} objects for the declared public
 61      * methods of this class or interface that have the specified method name
 62      * and parameter types.
 63      */
 64     List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
 65 
 66     /**
 67      * Return the constant pool for a class.
 68      */
 69     ConstantPool getConstantPool(Class<?> klass);
 70 
 71     /**
 72      * Compare-And-Set the AnnotationType instance corresponding to this class.
 73      * (This method only applies to annotation types.)

399 
400     /**
401      * Join strings
402      */
403     String join(String prefix, String suffix, String delimiter, String[] elements, int size);
404 
405     /*
406      * Get the class data associated with the given class.
407      * @param c the class
408      * @see java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)
409      */
410     Object classData(Class<?> c);
411 
412     long findNative(ClassLoader loader, String entry);
413 
414     /**
415      * Direct access to Shutdown.exit to avoid security manager checks
416      * @param statusCode the status code
417      */
418     void exit(int statusCode);
419     /**
420      * Returns an array of all platform threads.
421      */
422     Thread[] getAllThreads();
423 
424     /**
425      * Returns the ThreadContainer for a thread, may be null.
426      */
427     ThreadContainer threadContainer(Thread thread);
428 
429     /**
430      * Starts a thread in the given ThreadContainer.
431      */
432     void start(Thread thread, ThreadContainer container);
433 
434     /**
435      * Returns the top of the given thread's stackable scope stack.
436      */
437     StackableScope headStackableScope(Thread thread);
438 
439     /**
440      * Sets the top of the current thread's stackable scope stack.
441      */
442     void setHeadStackableScope(StackableScope scope);
443 
444     /**
445      * Returns a reference to the Thread object for the currently executing
446      * carrier thread.
447      */
448     Thread currentCarrierThread();
449 
450     /**
451      * Executes the given value returning task on the current carrier thread.
452      */
453     <V> V executeOnCarrierThread(Callable<V> task) throws Exception;
454 
455     /**
456      * Returns the value of the current carrier thread's copy of a thread-local.
457      */
458     <T> T getCarrierThreadLocal(ThreadLocal<T> local);
459 
460     /**
461      * Sets the value of the current carrier thread's copy of a thread-local.
462      */
463     <T> void setCarrierThreadLocal(ThreadLocal<T> local, T value);
464 
465     /**
466      * Returns the current thread's scope locals cache
467      */
468     Object[] scopeLocalCache();
469 
470     /**
471      * Sets the current thread's scope locals cache
472      */
473     void setScopeLocalCache(Object[] cache);
474 
475     /**
476      * Return the current thread's scope local bindings.
477      */
478     Object scopeLocalBindings();
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 >