Exemple #1
0
        public unsafe global::Java.Util.Concurrent.IScheduledFuture Schedule(global::Java.Util.Concurrent.ICallable callable, long delay, global::Java.Util.Concurrent.TimeUnit unit)
        {
            if (id_schedule_Ljava_util_concurrent_Callable_JLjava_util_concurrent_TimeUnit_ == IntPtr.Zero)
            {
                id_schedule_Ljava_util_concurrent_Callable_JLjava_util_concurrent_TimeUnit_ = JNIEnv.GetMethodID(class_ref, "schedule", "(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;");
            }
            JValue *__args = stackalloc JValue[3];

            __args[0] = new JValue(callable);
            __args[1] = new JValue(delay);
            __args[2] = new JValue(unit);
            global::Java.Util.Concurrent.IScheduledFuture __ret = global::Java.Lang.Object.GetObject <global::Java.Util.Concurrent.IScheduledFuture>(JNIEnv.CallObjectMethod(((global::Java.Lang.Object) this).Handle, id_schedule_Ljava_util_concurrent_Callable_JLjava_util_concurrent_TimeUnit_, __args), JniHandleOwnership.TransferLocalRef);
            return(__ret);
        }
Exemple #2
0
        public unsafe global::Java.Util.Concurrent.IScheduledFuture ScheduleWithFixedDelay(global::Java.Lang.IRunnable command, long initialDelay, long delay, global::Java.Util.Concurrent.TimeUnit unit)
        {
            if (id_scheduleWithFixedDelay_Ljava_lang_Runnable_JJLjava_util_concurrent_TimeUnit_ == IntPtr.Zero)
            {
                id_scheduleWithFixedDelay_Ljava_lang_Runnable_JJLjava_util_concurrent_TimeUnit_ = JNIEnv.GetMethodID(class_ref, "scheduleWithFixedDelay", "(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;");
            }
            JValue *__args = stackalloc JValue[4];

            __args[0] = new JValue(command);
            __args[1] = new JValue(initialDelay);
            __args[2] = new JValue(delay);
            __args[3] = new JValue(unit);
            global::Java.Util.Concurrent.IScheduledFuture __ret = global::Java.Lang.Object.GetObject <global::Java.Util.Concurrent.IScheduledFuture>(JNIEnv.CallObjectMethod(((global::Java.Lang.Object) this).Handle, id_scheduleWithFixedDelay_Ljava_lang_Runnable_JJLjava_util_concurrent_TimeUnit_, __args), JniHandleOwnership.TransferLocalRef);
            return(__ret);
        }
 public static unsafe global::Java.Util.Concurrent.IScheduledFuture Schedule(global::Java.Lang.IRunnable p0, long p1, global::Java.Util.Concurrent.TimeUnit p2)
 {
     if (id_schedule_Ljava_lang_Runnable_JLjava_util_concurrent_TimeUnit_ == IntPtr.Zero)
     {
         id_schedule_Ljava_lang_Runnable_JLjava_util_concurrent_TimeUnit_ = JNIEnv.GetStaticMethodID(class_ref, "schedule", "(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;");
     }
     try {
         JValue *__args = stackalloc JValue [3];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         __args [2] = new JValue(p2);
         global::Java.Util.Concurrent.IScheduledFuture __ret = global::Java.Lang.Object.GetObject <global::Java.Util.Concurrent.IScheduledFuture> (JNIEnv.CallStaticObjectMethod(class_ref, id_schedule_Ljava_lang_Runnable_JLjava_util_concurrent_TimeUnit_, __args), JniHandleOwnership.TransferLocalRef);
         return(__ret);
     } finally {
     }
 }