-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCompletionService.swift
More file actions
126 lines (86 loc) · 6.1 KB
/
CompletionService.swift
File metadata and controls
126 lines (86 loc) · 6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import java_swift
import java_lang
/// generated by: genswift.java 'java/lang|java/util|java/sql|java/awt|javax/swing' ///
/// interface java.util.concurrent.CompletionService ///
public protocol CompletionService: JavaProtocol {
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.poll(long,java.util.concurrent.TimeUnit) throws java.lang.InterruptedException
func poll( timeout: Int64, unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Future!
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.poll()
func poll() -> Future!
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.submit(java.util.concurrent.Callable)
func submit( task: Callable? ) -> Future!
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.submit(java.lang.Runnable,java.lang.Object)
func submit( task: java_swift.Runnable?, result: java_swift.JavaObject? ) -> Future!
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.take() throws java.lang.InterruptedException
func take() throws /* java.lang.InterruptedException */ -> Future!
}
open class CompletionServiceForward: JNIObjectForward, CompletionService {
private static var CompletionServiceJNIClass: jclass?
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.poll(long,java.util.concurrent.TimeUnit) throws java.lang.InterruptedException
private static var poll_MethodID_6: jmethodID?
open func poll( timeout: Int64, unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Future! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = jvalue( j: timeout )
__args[1] = JNIType.toJava( value: unit, locals: &__locals )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "poll", methodSig: "(JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/Future;", methodCache: &CompletionServiceForward.poll_MethodID_6, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
return __return != nil ? FutureForward( javaObject: __return ) : nil
}
open func poll( _ _timeout: Int64, _ _unit: TimeUnit? ) throws /* java.lang.InterruptedException */ -> Future! {
return try poll( timeout: _timeout, unit: _unit )
}
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.poll()
private static var poll_MethodID_7: jmethodID?
open func poll() -> Future! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "poll", methodSig: "()Ljava/util/concurrent/Future;", methodCache: &CompletionServiceForward.poll_MethodID_7, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? FutureForward( javaObject: __return ) : nil
}
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.submit(java.util.concurrent.Callable)
private static var submit_MethodID_8: jmethodID?
open func submit( task: Callable? ) -> Future! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: task, locals: &__locals )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "submit", methodSig: "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;", methodCache: &CompletionServiceForward.submit_MethodID_8, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? FutureForward( javaObject: __return ) : nil
}
open func submit( _ _task: Callable? ) -> Future! {
return submit( task: _task )
}
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.submit(java.lang.Runnable,java.lang.Object)
private static var submit_MethodID_9: jmethodID?
open func submit( task: java_swift.Runnable?, result: java_swift.JavaObject? ) -> Future! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = JNIType.toJava( value: task, locals: &__locals )
__args[1] = JNIType.toJava( value: result, locals: &__locals )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "submit", methodSig: "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Future;", methodCache: &CompletionServiceForward.submit_MethodID_9, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? FutureForward( javaObject: __return ) : nil
}
open func submit( _ _task: java_swift.Runnable?, _ _result: java_swift.JavaObject? ) -> Future! {
return submit( task: _task, result: _result )
}
/// public abstract java.util.concurrent.Future java.util.concurrent.CompletionService.take() throws java.lang.InterruptedException
private static var take_MethodID_10: jmethodID?
open func take() throws /* java.lang.InterruptedException */ -> Future! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "take", methodSig: "()Ljava/util/concurrent/Future;", methodCache: &CompletionServiceForward.take_MethodID_10, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw java_lang.InterruptedException( javaObject: throwable )
}
return __return != nil ? FutureForward( javaObject: __return ) : nil
}
}