< prev index next >

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

Print this page




  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.lang.annotation.Annotation;
  29 import java.lang.module.ModuleDescriptor;
  30 import java.lang.reflect.Executable;
  31 import java.lang.reflect.Method;
  32 import java.net.URI;
  33 import java.nio.charset.CharacterCodingException;
  34 import java.nio.charset.Charset;
  35 import java.security.AccessControlContext;
  36 import java.security.ProtectionDomain;
  37 import java.util.Iterator;
  38 import java.util.List;
  39 import java.util.Map;

  40 import java.util.concurrent.ConcurrentHashMap;
  41 import java.util.stream.Stream;
  42 
  43 import jdk.internal.module.ServicesCatalog;
  44 import jdk.internal.reflect.ConstantPool;
  45 import sun.reflect.annotation.AnnotationType;
  46 import sun.nio.ch.Interruptible;
  47 
  48 public interface JavaLangAccess {
  49 
  50     /**
  51      * Returns the list of {@code Method} objects for the declared public
  52      * methods of this class or interface that have the specified method name
  53      * and parameter types.
  54      */
  55     List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
  56 
  57     /**
  58      * Return the constant pool for a class.
  59      */


 302      *
 303      * @param s the string to encode
 304      * @return the encoded bytes in utf8
 305      * @throws IllegalArgumentException for malformed surrogates
 306      */
 307     byte[] getBytesUTF8NoRepl(String s);
 308 
 309     /**
 310      * Set the cause of Throwable
 311      * @param cause set t's cause to new value
 312      */
 313     void setCause(Throwable t, Throwable cause);
 314 
 315     /**
 316      * Privileged System.loadLibrary
 317      *
 318      * @param caller on behalf of which the library is being loaded
 319      * @param library name of the library to load
 320      */
 321     void loadLibrary(Class<?> caller, String library);



































































 322 }


  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.lang.annotation.Annotation;
  29 import java.lang.module.ModuleDescriptor;
  30 import java.lang.reflect.Executable;
  31 import java.lang.reflect.Method;
  32 import java.net.URI;
  33 import java.nio.charset.CharacterCodingException;
  34 import java.nio.charset.Charset;
  35 import java.security.AccessControlContext;
  36 import java.security.ProtectionDomain;
  37 import java.util.Iterator;
  38 import java.util.List;
  39 import java.util.Map;
  40 import java.util.concurrent.Callable;
  41 import java.util.concurrent.ConcurrentHashMap;
  42 import java.util.stream.Stream;
  43 
  44 import jdk.internal.module.ServicesCatalog;
  45 import jdk.internal.reflect.ConstantPool;
  46 import sun.reflect.annotation.AnnotationType;
  47 import sun.nio.ch.Interruptible;
  48 
  49 public interface JavaLangAccess {
  50 
  51     /**
  52      * Returns the list of {@code Method} objects for the declared public
  53      * methods of this class or interface that have the specified method name
  54      * and parameter types.
  55      */
  56     List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
  57 
  58     /**
  59      * Return the constant pool for a class.
  60      */


 303      *
 304      * @param s the string to encode
 305      * @return the encoded bytes in utf8
 306      * @throws IllegalArgumentException for malformed surrogates
 307      */
 308     byte[] getBytesUTF8NoRepl(String s);
 309 
 310     /**
 311      * Set the cause of Throwable
 312      * @param cause set t's cause to new value
 313      */
 314     void setCause(Throwable t, Throwable cause);
 315 
 316     /**
 317      * Privileged System.loadLibrary
 318      *
 319      * @param caller on behalf of which the library is being loaded
 320      * @param library name of the library to load
 321      */
 322     void loadLibrary(Class<?> caller, String library);
 323 
 324     /**
 325      * Returns a reference to the Thread object for the currently executing
 326      * carrier thread.
 327      */
 328     Thread currentCarrierThread();
 329 
 330     /**
 331      * Executes the given value returning task on the current carrier thread.
 332      */
 333     <R> R executeOnCarrierThread(Callable<R> task) throws Exception;
 334 
 335     /**
 336      * Returns the value in the current carrier thread's copy of a
 337      * thread-local variable.
 338      */
 339     <T> T getCarrierThreadLocal(ThreadLocal<T> local);
 340 
 341     /**
 342      * Returns the Fiber for the given shadow Thread object. Returns null if
 343      * the thread is not a shadow thread.
 344      */
 345     Fiber<?> getFiber(Thread t);
 346 
 347     /**
 348      * Returns the shadow thread for the given fiber or null if it does not
 349      * have a shadow thread.
 350      */
 351     Thread getShadowThread(Fiber<?> f);
 352 
 353     /**
 354      * Returns the currently executing strand. If executed from a running fiber
 355      * then the {@link Fiber} object will be returned, otherwise the {@code
 356      * Thread} object.
 357      */
 358     Object currentStrand();
 359 
 360     /**
 361      * Interrupt the given strand.
 362      */
 363     void interrupt(Object strand);
 364 
 365     /**
 366      * Returns the current strand's interrupt status
 367      */
 368     boolean isInterrupted();
 369 
 370     /**
 371      * Clear the current strand's interrupt status
 372      */
 373     boolean clearInterrupt();
 374 
 375     /**
 376      * Disables the current fiber for scheduling purposes.
 377      */
 378     void parkFiber();
 379 
 380     /**
 381      * Disables the current fiber for scheduling purposes for up to the
 382      * given waiting time.
 383      */
 384     void parkFiber(long nanos);
 385 
 386     /**
 387      * Re-enables a fiber for scheduling.
 388      */
 389     void unparkFiber(Fiber<?> fiber);
 390 }
< prev index next >