27 |
28 | @class
29 | */
30 | var FileProps = function(j_val) {
31 |
32 | var j_fileProps = j_val;
33 | var that = this;
34 |
35 | /**
36 | The date the file was created
37 |
38 | @public
39 |
40 | @return {number}
41 | */
42 | this.creationTime = function() {
43 | var __args = arguments;
44 | if (__args.length === 0) {
45 | return j_fileProps["creationTime()"]();
46 | } else throw new TypeError('function invoked with invalid arguments');
47 | };
48 |
49 | /**
50 | The date the file was last accessed
51 |
52 | @public
53 |
54 | @return {number}
55 | */
56 | this.lastAccessTime = function() {
57 | var __args = arguments;
58 | if (__args.length === 0) {
59 | return j_fileProps["lastAccessTime()"]();
60 | } else throw new TypeError('function invoked with invalid arguments');
61 | };
62 |
63 | /**
64 | The date the file was last modified
65 |
66 | @public
67 |
68 | @return {number}
69 | */
70 | this.lastModifiedTime = function() {
71 | var __args = arguments;
72 | if (__args.length === 0) {
73 | return j_fileProps["lastModifiedTime()"]();
74 | } else throw new TypeError('function invoked with invalid arguments');
75 | };
76 |
77 | /**
78 | Is the file a directory?
79 |
80 | @public
81 |
82 | @return {boolean}
83 | */
84 | this.isDirectory = function() {
85 | var __args = arguments;
86 | if (__args.length === 0) {
87 | return j_fileProps["isDirectory()"]();
88 | } else throw new TypeError('function invoked with invalid arguments');
89 | };
90 |
91 | /**
92 | Is the file some other type? (I.e. not a directory, regular file or symbolic link)
93 |
94 | @public
95 |
96 | @return {boolean}
97 | */
98 | this.isOther = function() {
99 | var __args = arguments;
100 | if (__args.length === 0) {
101 | return j_fileProps["isOther()"]();
102 | } else throw new TypeError('function invoked with invalid arguments');
103 | };
104 |
105 | /**
106 | Is the file a regular file?
107 |
108 | @public
109 |
110 | @return {boolean}
111 | */
112 | this.isRegularFile = function() {
113 | var __args = arguments;
114 | if (__args.length === 0) {
115 | return j_fileProps["isRegularFile()"]();
116 | } else throw new TypeError('function invoked with invalid arguments');
117 | };
118 |
119 | /**
120 | Is the file a symbolic link?
121 |
122 | @public
123 |
124 | @return {boolean}
125 | */
126 | this.isSymbolicLink = function() {
127 | var __args = arguments;
128 | if (__args.length === 0) {
129 | return j_fileProps["isSymbolicLink()"]();
130 | } else throw new TypeError('function invoked with invalid arguments');
131 | };
132 |
133 | /**
134 | The size of the file, in bytes
135 |
136 | @public
137 |
138 | @return {number}
139 | */
140 | this.size = function() {
141 | var __args = arguments;
142 | if (__args.length === 0) {
143 | return j_fileProps["size()"]();
144 | } else throw new TypeError('function invoked with invalid arguments');
145 | };
146 |
147 | // A reference to the underlying Java delegate
148 | // NOTE! This is an internal API and must not be used in user code.
149 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
150 | this._jdel = j_fileProps;
151 | };
152 |
153 | FileProps._jclass = utils.getJavaClass("io.vertx.core.file.FileProps");
154 | FileProps._jtype = {
155 | accept: function(obj) {
156 | return FileProps._jclass.isInstance(obj._jdel);
157 | },
158 | wrap: function(jdel) {
159 | var obj = Object.create(FileProps.prototype, {});
160 | FileProps.apply(obj, arguments);
161 | return obj;
162 | },
163 | unwrap: function(obj) {
164 | return obj._jdel;
165 | }
166 | };
167 | FileProps._create = function(jdel) {
168 | var obj = Object.create(FileProps.prototype, {});
169 | FileProps.apply(obj, arguments);
170 | return obj;
171 | }
172 | module.exports = FileProps;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/file_system_props.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/file_system_props */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JFileSystemProps = Java.type('io.vertx.core.file.FileSystemProps');
23 |
24 | /**
25 | Represents properties of the file system.
26 |
27 |
28 | @class
29 | */
30 | var FileSystemProps = function(j_val) {
31 |
32 | var j_fileSystemProps = j_val;
33 | var that = this;
34 |
35 | /**
36 |
37 | @public
38 |
39 | @return {number} The total space on the file system, in bytes
40 | */
41 | this.totalSpace = function() {
42 | var __args = arguments;
43 | if (__args.length === 0) {
44 | return j_fileSystemProps["totalSpace()"]();
45 | } else throw new TypeError('function invoked with invalid arguments');
46 | };
47 |
48 | /**
49 |
50 | @public
51 |
52 | @return {number} The total un-allocated space on the file system, in bytes
53 | */
54 | this.unallocatedSpace = function() {
55 | var __args = arguments;
56 | if (__args.length === 0) {
57 | return j_fileSystemProps["unallocatedSpace()"]();
58 | } else throw new TypeError('function invoked with invalid arguments');
59 | };
60 |
61 | /**
62 |
63 | @public
64 |
65 | @return {number} The total usable space on the file system, in bytes
66 | */
67 | this.usableSpace = function() {
68 | var __args = arguments;
69 | if (__args.length === 0) {
70 | return j_fileSystemProps["usableSpace()"]();
71 | } else throw new TypeError('function invoked with invalid arguments');
72 | };
73 |
74 | // A reference to the underlying Java delegate
75 | // NOTE! This is an internal API and must not be used in user code.
76 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
77 | this._jdel = j_fileSystemProps;
78 | };
79 |
80 | FileSystemProps._jclass = utils.getJavaClass("io.vertx.core.file.FileSystemProps");
81 | FileSystemProps._jtype = {
82 | accept: function(obj) {
83 | return FileSystemProps._jclass.isInstance(obj._jdel);
84 | },
85 | wrap: function(jdel) {
86 | var obj = Object.create(FileSystemProps.prototype, {});
87 | FileSystemProps.apply(obj, arguments);
88 | return obj;
89 | },
90 | unwrap: function(obj) {
91 | return obj._jdel;
92 | }
93 | };
94 | FileSystemProps._create = function(jdel) {
95 | var obj = Object.create(FileSystemProps.prototype, {});
96 | FileSystemProps.apply(obj, arguments);
97 | return obj;
98 | }
99 | module.exports = FileSystemProps;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/http_frame.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/http_frame */
18 | var utils = require('vertx-js/util/utils');
19 | var Buffer = require('vertx-js/buffer');
20 |
21 | var io = Packages.io;
22 | var JsonObject = io.vertx.core.json.JsonObject;
23 | var JHttpFrame = Java.type('io.vertx.core.http.HttpFrame');
24 |
25 | /**
26 | An HTTP/2 frame.
27 |
28 | @class
29 | */
30 | var HttpFrame = function(j_val) {
31 |
32 | var j_httpFrame = j_val;
33 | var that = this;
34 |
35 | /**
36 |
37 | @public
38 |
39 | @return {number} the 8-bit type of the frame
40 | */
41 | this.type = function() {
42 | var __args = arguments;
43 | if (__args.length === 0) {
44 | if (that.cachedtype == null) {
45 | that.cachedtype = j_httpFrame["type()"]();
46 | }
47 | return that.cachedtype;
48 | } else throw new TypeError('function invoked with invalid arguments');
49 | };
50 |
51 | /**
52 |
53 | @public
54 |
55 | @return {number} the 8-bit flags specific to the frame
56 | */
57 | this.flags = function() {
58 | var __args = arguments;
59 | if (__args.length === 0) {
60 | if (that.cachedflags == null) {
61 | that.cachedflags = j_httpFrame["flags()"]();
62 | }
63 | return that.cachedflags;
64 | } else throw new TypeError('function invoked with invalid arguments');
65 | };
66 |
67 | /**
68 |
69 | @public
70 |
71 | @return {Buffer} the frame payload
72 | */
73 | this.payload = function() {
74 | var __args = arguments;
75 | if (__args.length === 0) {
76 | if (that.cachedpayload == null) {
77 | that.cachedpayload = utils.convReturnVertxGen(Buffer, j_httpFrame["payload()"]());
78 | }
79 | return that.cachedpayload;
80 | } else throw new TypeError('function invoked with invalid arguments');
81 | };
82 |
83 | // A reference to the underlying Java delegate
84 | // NOTE! This is an internal API and must not be used in user code.
85 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
86 | this._jdel = j_httpFrame;
87 | };
88 |
89 | HttpFrame._jclass = utils.getJavaClass("io.vertx.core.http.HttpFrame");
90 | HttpFrame._jtype = {
91 | accept: function(obj) {
92 | return HttpFrame._jclass.isInstance(obj._jdel);
93 | },
94 | wrap: function(jdel) {
95 | var obj = Object.create(HttpFrame.prototype, {});
96 | HttpFrame.apply(obj, arguments);
97 | return obj;
98 | },
99 | unwrap: function(obj) {
100 | return obj._jdel;
101 | }
102 | };
103 | HttpFrame._create = function(jdel) {
104 | var obj = Object.create(HttpFrame.prototype, {});
105 | HttpFrame.apply(obj, arguments);
106 | return obj;
107 | }
108 | module.exports = HttpFrame;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/lock.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/lock */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JLock = Java.type('io.vertx.core.shareddata.Lock');
23 |
24 | /**
25 | An asynchronous exclusive lock which can be obtained from any node in the cluster.
26 |
27 | When the lock is obtained, no-one else in the cluster can obtain the lock with the same name until the lock
28 | is released.
29 |
30 | @class
31 | */
32 | var Lock = function(j_val) {
33 |
34 | var j_lock = j_val;
35 | var that = this;
36 |
37 | /**
38 | Release the lock. Once the lock is released another will be able to obtain the lock.
39 |
40 | @public
41 |
42 | */
43 | this.release = function() {
44 | var __args = arguments;
45 | if (__args.length === 0) {
46 | j_lock["release()"]();
47 | } else throw new TypeError('function invoked with invalid arguments');
48 | };
49 |
50 | // A reference to the underlying Java delegate
51 | // NOTE! This is an internal API and must not be used in user code.
52 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
53 | this._jdel = j_lock;
54 | };
55 |
56 | Lock._jclass = utils.getJavaClass("io.vertx.core.shareddata.Lock");
57 | Lock._jtype = {
58 | accept: function(obj) {
59 | return Lock._jclass.isInstance(obj._jdel);
60 | },
61 | wrap: function(jdel) {
62 | var obj = Object.create(Lock.prototype, {});
63 | Lock.apply(obj, arguments);
64 | return obj;
65 | },
66 | unwrap: function(obj) {
67 | return obj._jdel;
68 | }
69 | };
70 | Lock._create = function(jdel) {
71 | var obj = Object.create(Lock.prototype, {});
72 | Lock.apply(obj, arguments);
73 | return obj;
74 | }
75 | module.exports = Lock;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/measured.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/measured */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JMeasured = Java.type('io.vertx.core.metrics.Measured');
23 |
24 | /**
25 |
26 | @class
27 | */
28 | var Measured = function(j_val) {
29 |
30 | var j_measured = j_val;
31 | var that = this;
32 |
33 | /**
34 | Whether the metrics are enabled for this measured object
35 |
36 | @public
37 |
38 | @return {boolean} true if the metrics are enabled
39 | */
40 | this.isMetricsEnabled = function() {
41 | var __args = arguments;
42 | if (__args.length === 0) {
43 | return j_measured["isMetricsEnabled()"]();
44 | } else throw new TypeError('function invoked with invalid arguments');
45 | };
46 |
47 | // A reference to the underlying Java delegate
48 | // NOTE! This is an internal API and must not be used in user code.
49 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
50 | this._jdel = j_measured;
51 | };
52 |
53 | Measured._jclass = utils.getJavaClass("io.vertx.core.metrics.Measured");
54 | Measured._jtype = {
55 | accept: function(obj) {
56 | return Measured._jclass.isInstance(obj._jdel);
57 | },
58 | wrap: function(jdel) {
59 | var obj = Object.create(Measured.prototype, {});
60 | Measured.apply(obj, arguments);
61 | return obj;
62 | },
63 | unwrap: function(obj) {
64 | return obj._jdel;
65 | }
66 | };
67 | Measured._create = function(jdel) {
68 | var obj = Object.create(Measured.prototype, {});
69 | Measured.apply(obj, arguments);
70 | return obj;
71 | }
72 | module.exports = Measured;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/mx_record.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/mx_record */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JMxRecord = Java.type('io.vertx.core.dns.MxRecord');
23 |
24 | /**
25 | Represent a Mail-Exchange-Record (MX) which was resolved for a domain.
26 |
27 | @class
28 | */
29 | var MxRecord = function(j_val) {
30 |
31 | var j_mxRecord = j_val;
32 | var that = this;
33 |
34 | /**
35 | The priority of the MX record.
36 |
37 | @public
38 |
39 | @return {number}
40 | */
41 | this.priority = function() {
42 | var __args = arguments;
43 | if (__args.length === 0) {
44 | return j_mxRecord["priority()"]();
45 | } else throw new TypeError('function invoked with invalid arguments');
46 | };
47 |
48 | /**
49 | The name of the MX record
50 |
51 | @public
52 |
53 | @return {string}
54 | */
55 | this.name = function() {
56 | var __args = arguments;
57 | if (__args.length === 0) {
58 | return j_mxRecord["name()"]();
59 | } else throw new TypeError('function invoked with invalid arguments');
60 | };
61 |
62 | // A reference to the underlying Java delegate
63 | // NOTE! This is an internal API and must not be used in user code.
64 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
65 | this._jdel = j_mxRecord;
66 | };
67 |
68 | MxRecord._jclass = utils.getJavaClass("io.vertx.core.dns.MxRecord");
69 | MxRecord._jtype = {
70 | accept: function(obj) {
71 | return MxRecord._jclass.isInstance(obj._jdel);
72 | },
73 | wrap: function(jdel) {
74 | var obj = Object.create(MxRecord.prototype, {});
75 | MxRecord.apply(obj, arguments);
76 | return obj;
77 | },
78 | unwrap: function(obj) {
79 | return obj._jdel;
80 | }
81 | };
82 | MxRecord._create = function(jdel) {
83 | var obj = Object.create(MxRecord.prototype, {});
84 | MxRecord.apply(obj, arguments);
85 | return obj;
86 | }
87 | module.exports = MxRecord;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/read_stream.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/read_stream */
18 | var utils = require('vertx-js/util/utils');
19 | var StreamBase = require('vertx-js/stream_base');
20 |
21 | var io = Packages.io;
22 | var JsonObject = io.vertx.core.json.JsonObject;
23 | var JReadStream = Java.type('io.vertx.core.streams.ReadStream');
24 |
25 | /**
26 | Represents a stream of items that can be read from.
27 |
28 | @class
29 | */
30 | var ReadStream = function(j_val, j_arg_0) {
31 |
32 | var j_readStream = j_val;
33 | var that = this;
34 | var j_T = typeof j_arg_0 !== 'undefined' ? j_arg_0 : utils.unknown_jtype;
35 | StreamBase.call(this, j_val);
36 |
37 | /**
38 | Set an exception handler on the read stream.
39 |
40 | @public
41 | @param handler {function} the exception handler
42 | @return {ReadStream} a reference to this, so the API can be used fluently
43 | */
44 | this.exceptionHandler = function(handler) {
45 | var __args = arguments;
46 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
47 | j_readStream["exceptionHandler(io.vertx.core.Handler)"](handler == null ? null : function(jVal) {
48 | handler(utils.convReturnThrowable(jVal));
49 | });
50 | return that;
51 | } else throw new TypeError('function invoked with invalid arguments');
52 | };
53 |
54 | /**
55 | Set a data handler. As data is read, the handler will be called with the data.
56 |
57 | @public
58 | @param handler {function}
59 | @return {ReadStream} a reference to this, so the API can be used fluently
60 | */
61 | this.handler = function(handler) {
62 | var __args = arguments;
63 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
64 | j_readStream["handler(io.vertx.core.Handler)"](handler == null ? null : function(jVal) {
65 | handler(j_T.wrap(jVal));
66 | });
67 | return that;
68 | } else throw new TypeError('function invoked with invalid arguments');
69 | };
70 |
71 | /**
72 | Pause the ReadSupport. While it's paused, no data will be sent to the dataHandler
73 |
74 | @public
75 |
76 | @return {ReadStream} a reference to this, so the API can be used fluently
77 | */
78 | this.pause = function() {
79 | var __args = arguments;
80 | if (__args.length === 0) {
81 | j_readStream["pause()"]();
82 | return that;
83 | } else throw new TypeError('function invoked with invalid arguments');
84 | };
85 |
86 | /**
87 | Resume reading. If the ReadSupport has been paused, reading will recommence on it.
88 |
89 | @public
90 |
91 | @return {ReadStream} a reference to this, so the API can be used fluently
92 | */
93 | this.resume = function() {
94 | var __args = arguments;
95 | if (__args.length === 0) {
96 | j_readStream["resume()"]();
97 | return that;
98 | } else throw new TypeError('function invoked with invalid arguments');
99 | };
100 |
101 | /**
102 | Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
103 |
104 | @public
105 | @param endHandler {function}
106 | @return {ReadStream} a reference to this, so the API can be used fluently
107 | */
108 | this.endHandler = function(endHandler) {
109 | var __args = arguments;
110 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
111 | j_readStream["endHandler(io.vertx.core.Handler)"](endHandler);
112 | return that;
113 | } else throw new TypeError('function invoked with invalid arguments');
114 | };
115 |
116 | // A reference to the underlying Java delegate
117 | // NOTE! This is an internal API and must not be used in user code.
118 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
119 | this._jdel = j_readStream;
120 | };
121 |
122 | ReadStream._jclass = utils.getJavaClass("io.vertx.core.streams.ReadStream");
123 | ReadStream._jtype = {
124 | accept: function(obj) {
125 | return ReadStream._jclass.isInstance(obj._jdel);
126 | },
127 | wrap: function(jdel) {
128 | var obj = Object.create(ReadStream.prototype, {});
129 | ReadStream.apply(obj, arguments);
130 | return obj;
131 | },
132 | unwrap: function(obj) {
133 | return obj._jdel;
134 | }
135 | };
136 | ReadStream._create = function(jdel) {
137 | var obj = Object.create(ReadStream.prototype, {});
138 | ReadStream.apply(obj, arguments);
139 | return obj;
140 | }
141 | module.exports = ReadStream;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/send_context.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/send_context */
18 | var utils = require('vertx-js/util/utils');
19 | var Message = require('vertx-js/message');
20 |
21 | var io = Packages.io;
22 | var JsonObject = io.vertx.core.json.JsonObject;
23 | var JSendContext = Java.type('io.vertx.core.eventbus.SendContext');
24 |
25 | /**
26 |
27 | Encapsulates a message being sent from Vert.x. Used with event bus interceptors
28 |
29 | @class
30 | */
31 | var SendContext = function(j_val, j_arg_0) {
32 |
33 | var j_sendContext = j_val;
34 | var that = this;
35 | var j_T = typeof j_arg_0 !== 'undefined' ? j_arg_0 : utils.unknown_jtype;
36 |
37 | /**
38 |
39 | @public
40 |
41 | @return {Message} The message being sent
42 | */
43 | this.message = function() {
44 | var __args = arguments;
45 | if (__args.length === 0) {
46 | return utils.convReturnVertxGen(Message, j_sendContext["message()"](), undefined);
47 | } else throw new TypeError('function invoked with invalid arguments');
48 | };
49 |
50 | /**
51 | Call the next interceptor
52 |
53 | @public
54 |
55 | */
56 | this.next = function() {
57 | var __args = arguments;
58 | if (__args.length === 0) {
59 | j_sendContext["next()"]();
60 | } else throw new TypeError('function invoked with invalid arguments');
61 | };
62 |
63 | /**
64 |
65 | @public
66 |
67 | @return {boolean} true if the message is being sent (point to point) or False if the message is being published
68 | */
69 | this.send = function() {
70 | var __args = arguments;
71 | if (__args.length === 0) {
72 | return j_sendContext["send()"]();
73 | } else throw new TypeError('function invoked with invalid arguments');
74 | };
75 |
76 | /**
77 |
78 | @public
79 |
80 | @return {Object} the value sent or published (before being processed by the codec)
81 | */
82 | this.sentBody = function() {
83 | var __args = arguments;
84 | if (__args.length === 0) {
85 | return utils.convReturnTypeUnknown(j_sendContext["sentBody()"]());
86 | } else throw new TypeError('function invoked with invalid arguments');
87 | };
88 |
89 | // A reference to the underlying Java delegate
90 | // NOTE! This is an internal API and must not be used in user code.
91 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
92 | this._jdel = j_sendContext;
93 | };
94 |
95 | SendContext._jclass = utils.getJavaClass("io.vertx.core.eventbus.SendContext");
96 | SendContext._jtype = {
97 | accept: function(obj) {
98 | return SendContext._jclass.isInstance(obj._jdel);
99 | },
100 | wrap: function(jdel) {
101 | var obj = Object.create(SendContext.prototype, {});
102 | SendContext.apply(obj, arguments);
103 | return obj;
104 | },
105 | unwrap: function(obj) {
106 | return obj._jdel;
107 | }
108 | };
109 | SendContext._create = function(jdel) {
110 | var obj = Object.create(SendContext.prototype, {});
111 | SendContext.apply(obj, arguments);
112 | return obj;
113 | }
114 | module.exports = SendContext;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/socket_address.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/socket_address */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JSocketAddress = Java.type('io.vertx.core.net.SocketAddress');
23 |
24 | /**
25 | The address of a socket, an inet socket address or a domain socket address.
26 |
27 | @class
28 | */
29 | var SocketAddress = function(j_val) {
30 |
31 | var j_socketAddress = j_val;
32 | var that = this;
33 |
34 | /**
35 |
36 | @public
37 |
38 | @return {string} the address host or null for a domain socket
39 | */
40 | this.host = function() {
41 | var __args = arguments;
42 | if (__args.length === 0) {
43 | return j_socketAddress["host()"]();
44 | } else throw new TypeError('function invoked with invalid arguments');
45 | };
46 |
47 | /**
48 |
49 | @public
50 |
51 | @return {number} the address port or -1 for a domain socket
52 | */
53 | this.port = function() {
54 | var __args = arguments;
55 | if (__args.length === 0) {
56 | return j_socketAddress["port()"]();
57 | } else throw new TypeError('function invoked with invalid arguments');
58 | };
59 |
60 | /**
61 |
62 | @public
63 |
64 | @return {string} the address path or null for a inet socket
65 | */
66 | this.path = function() {
67 | var __args = arguments;
68 | if (__args.length === 0) {
69 | return j_socketAddress["path()"]();
70 | } else throw new TypeError('function invoked with invalid arguments');
71 | };
72 |
73 | // A reference to the underlying Java delegate
74 | // NOTE! This is an internal API and must not be used in user code.
75 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
76 | this._jdel = j_socketAddress;
77 | };
78 |
79 | SocketAddress._jclass = utils.getJavaClass("io.vertx.core.net.SocketAddress");
80 | SocketAddress._jtype = {
81 | accept: function(obj) {
82 | return SocketAddress._jclass.isInstance(obj._jdel);
83 | },
84 | wrap: function(jdel) {
85 | var obj = Object.create(SocketAddress.prototype, {});
86 | SocketAddress.apply(obj, arguments);
87 | return obj;
88 | },
89 | unwrap: function(obj) {
90 | return obj._jdel;
91 | }
92 | };
93 | SocketAddress._create = function(jdel) {
94 | var obj = Object.create(SocketAddress.prototype, {});
95 | SocketAddress.apply(obj, arguments);
96 | return obj;
97 | }
98 | /**
99 | Create a inet socket address, host must be non null and port must be between 0
100 | and 65536.
101 |
102 | @memberof module:vertx-js/socket_address
103 | @param port {number} the address port
104 | @param host {string} the address host
105 | @return {SocketAddress} the created socket address
106 | */
107 | SocketAddress.inetSocketAddress = function(port, host) {
108 | var __args = arguments;
109 | if (__args.length === 2 && typeof __args[0] ==='number' && typeof __args[1] === 'string') {
110 | return utils.convReturnVertxGen(SocketAddress, JSocketAddress["inetSocketAddress(int,java.lang.String)"](port, host));
111 | } else throw new TypeError('function invoked with invalid arguments');
112 | };
113 |
114 | /**
115 | Create a domain socket address.
116 |
117 | @memberof module:vertx-js/socket_address
118 | @param path {string} the address path
119 | @return {SocketAddress} the created socket address
120 | */
121 | SocketAddress.domainSocketAddress = function(path) {
122 | var __args = arguments;
123 | if (__args.length === 1 && typeof __args[0] === 'string') {
124 | return utils.convReturnVertxGen(SocketAddress, JSocketAddress["domainSocketAddress(java.lang.String)"](path));
125 | } else throw new TypeError('function invoked with invalid arguments');
126 | };
127 |
128 | module.exports = SocketAddress;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/srv_record.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/srv_record */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JSrvRecord = Java.type('io.vertx.core.dns.SrvRecord');
23 |
24 | /**
25 | Represent a Service-Record (SRV) which was resolved for a domain.
26 |
27 | @class
28 | */
29 | var SrvRecord = function(j_val) {
30 |
31 | var j_srvRecord = j_val;
32 | var that = this;
33 |
34 | /**
35 | Returns the priority for this service record.
36 |
37 | @public
38 |
39 | @return {number}
40 | */
41 | this.priority = function() {
42 | var __args = arguments;
43 | if (__args.length === 0) {
44 | return j_srvRecord["priority()"]();
45 | } else throw new TypeError('function invoked with invalid arguments');
46 | };
47 |
48 | /**
49 | Returns the weight of this service record.
50 |
51 | @public
52 |
53 | @return {number}
54 | */
55 | this.weight = function() {
56 | var __args = arguments;
57 | if (__args.length === 0) {
58 | return j_srvRecord["weight()"]();
59 | } else throw new TypeError('function invoked with invalid arguments');
60 | };
61 |
62 | /**
63 | Returns the port the service is running on.
64 |
65 | @public
66 |
67 | @return {number}
68 | */
69 | this.port = function() {
70 | var __args = arguments;
71 | if (__args.length === 0) {
72 | return j_srvRecord["port()"]();
73 | } else throw new TypeError('function invoked with invalid arguments');
74 | };
75 |
76 | /**
77 | Returns the name for the server being queried.
78 |
79 | @public
80 |
81 | @return {string}
82 | */
83 | this.name = function() {
84 | var __args = arguments;
85 | if (__args.length === 0) {
86 | return j_srvRecord["name()"]();
87 | } else throw new TypeError('function invoked with invalid arguments');
88 | };
89 |
90 | /**
91 | Returns the protocol for the service being queried (i.e. "_tcp").
92 |
93 | @public
94 |
95 | @return {string}
96 | */
97 | this.protocol = function() {
98 | var __args = arguments;
99 | if (__args.length === 0) {
100 | return j_srvRecord["protocol()"]();
101 | } else throw new TypeError('function invoked with invalid arguments');
102 | };
103 |
104 | /**
105 | Returns the service's name (i.e. "_http").
106 |
107 | @public
108 |
109 | @return {string}
110 | */
111 | this.service = function() {
112 | var __args = arguments;
113 | if (__args.length === 0) {
114 | return j_srvRecord["service()"]();
115 | } else throw new TypeError('function invoked with invalid arguments');
116 | };
117 |
118 | /**
119 | Returns the name of the host for the service.
120 |
121 | @public
122 |
123 | @return {string}
124 | */
125 | this.target = function() {
126 | var __args = arguments;
127 | if (__args.length === 0) {
128 | return j_srvRecord["target()"]();
129 | } else throw new TypeError('function invoked with invalid arguments');
130 | };
131 |
132 | // A reference to the underlying Java delegate
133 | // NOTE! This is an internal API and must not be used in user code.
134 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
135 | this._jdel = j_srvRecord;
136 | };
137 |
138 | SrvRecord._jclass = utils.getJavaClass("io.vertx.core.dns.SrvRecord");
139 | SrvRecord._jtype = {
140 | accept: function(obj) {
141 | return SrvRecord._jclass.isInstance(obj._jdel);
142 | },
143 | wrap: function(jdel) {
144 | var obj = Object.create(SrvRecord.prototype, {});
145 | SrvRecord.apply(obj, arguments);
146 | return obj;
147 | },
148 | unwrap: function(obj) {
149 | return obj._jdel;
150 | }
151 | };
152 | SrvRecord._create = function(jdel) {
153 | var obj = Object.create(SrvRecord.prototype, {});
154 | SrvRecord.apply(obj, arguments);
155 | return obj;
156 | }
157 | module.exports = SrvRecord;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/stream_base.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/stream_base */
18 | var utils = require('vertx-js/util/utils');
19 |
20 | var io = Packages.io;
21 | var JsonObject = io.vertx.core.json.JsonObject;
22 | var JStreamBase = Java.type('io.vertx.core.streams.StreamBase');
23 |
24 | /**
25 | Base interface for a stream.
26 |
27 | @class
28 | */
29 | var StreamBase = function(j_val) {
30 |
31 | var j_streamBase = j_val;
32 | var that = this;
33 |
34 | /**
35 | Set an exception handler.
36 |
37 | @public
38 | @param handler {function} the handler
39 | @return {StreamBase} a reference to this, so the API can be used fluently
40 | */
41 | this.exceptionHandler = function(handler) {
42 | var __args = arguments;
43 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
44 | j_streamBase["exceptionHandler(io.vertx.core.Handler)"](handler == null ? null : function(jVal) {
45 | handler(utils.convReturnThrowable(jVal));
46 | });
47 | return that;
48 | } else throw new TypeError('function invoked with invalid arguments');
49 | };
50 |
51 | // A reference to the underlying Java delegate
52 | // NOTE! This is an internal API and must not be used in user code.
53 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
54 | this._jdel = j_streamBase;
55 | };
56 |
57 | StreamBase._jclass = utils.getJavaClass("io.vertx.core.streams.StreamBase");
58 | StreamBase._jtype = {
59 | accept: function(obj) {
60 | return StreamBase._jclass.isInstance(obj._jdel);
61 | },
62 | wrap: function(jdel) {
63 | var obj = Object.create(StreamBase.prototype, {});
64 | StreamBase.apply(obj, arguments);
65 | return obj;
66 | },
67 | unwrap: function(obj) {
68 | return obj._jdel;
69 | }
70 | };
71 | StreamBase._create = function(jdel) {
72 | var obj = Object.create(StreamBase.prototype, {});
73 | StreamBase.apply(obj, arguments);
74 | return obj;
75 | }
76 | module.exports = StreamBase;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/timeout_stream.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/timeout_stream */
18 | var utils = require('vertx-js/util/utils');
19 | var ReadStream = require('vertx-js/read_stream');
20 |
21 | var io = Packages.io;
22 | var JsonObject = io.vertx.core.json.JsonObject;
23 | var JTimeoutStream = Java.type('io.vertx.core.TimeoutStream');
24 |
25 | /**
26 |
27 | @class
28 | */
29 | var TimeoutStream = function(j_val) {
30 |
31 | var j_timeoutStream = j_val;
32 | var that = this;
33 | ReadStream.call(this, j_val);
34 |
35 | /**
36 |
37 | @public
38 | @param handler {function}
39 | @return {TimeoutStream}
40 | */
41 | this.exceptionHandler = function(handler) {
42 | var __args = arguments;
43 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
44 | j_timeoutStream["exceptionHandler(io.vertx.core.Handler)"](handler == null ? null : function(jVal) {
45 | handler(utils.convReturnThrowable(jVal));
46 | });
47 | return that;
48 | } else throw new TypeError('function invoked with invalid arguments');
49 | };
50 |
51 | /**
52 |
53 | @public
54 | @param handler {function}
55 | @return {TimeoutStream}
56 | */
57 | this.handler = function(handler) {
58 | var __args = arguments;
59 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
60 | j_timeoutStream["handler(io.vertx.core.Handler)"](handler == null ? null : function(jVal) {
61 | handler(utils.convReturnLong(jVal));
62 | });
63 | return that;
64 | } else throw new TypeError('function invoked with invalid arguments');
65 | };
66 |
67 | /**
68 |
69 | @public
70 |
71 | @return {TimeoutStream}
72 | */
73 | this.pause = function() {
74 | var __args = arguments;
75 | if (__args.length === 0) {
76 | j_timeoutStream["pause()"]();
77 | return that;
78 | } else throw new TypeError('function invoked with invalid arguments');
79 | };
80 |
81 | /**
82 |
83 | @public
84 |
85 | @return {TimeoutStream}
86 | */
87 | this.resume = function() {
88 | var __args = arguments;
89 | if (__args.length === 0) {
90 | j_timeoutStream["resume()"]();
91 | return that;
92 | } else throw new TypeError('function invoked with invalid arguments');
93 | };
94 |
95 | /**
96 |
97 | @public
98 | @param endHandler {function}
99 | @return {TimeoutStream}
100 | */
101 | this.endHandler = function(endHandler) {
102 | var __args = arguments;
103 | if (__args.length === 1 && (typeof __args[0] === 'function' || __args[0] == null)) {
104 | j_timeoutStream["endHandler(io.vertx.core.Handler)"](endHandler);
105 | return that;
106 | } else throw new TypeError('function invoked with invalid arguments');
107 | };
108 |
109 | /**
110 | Cancels the timeout. Note this has the same effect as calling {@link TimeoutStream#handler} with a null
111 | argument.
112 |
113 | @public
114 |
115 | */
116 | this.cancel = function() {
117 | var __args = arguments;
118 | if (__args.length === 0) {
119 | j_timeoutStream["cancel()"]();
120 | } else throw new TypeError('function invoked with invalid arguments');
121 | };
122 |
123 | // A reference to the underlying Java delegate
124 | // NOTE! This is an internal API and must not be used in user code.
125 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
126 | this._jdel = j_timeoutStream;
127 | };
128 |
129 | TimeoutStream._jclass = utils.getJavaClass("io.vertx.core.TimeoutStream");
130 | TimeoutStream._jtype = {
131 | accept: function(obj) {
132 | return TimeoutStream._jclass.isInstance(obj._jdel);
133 | },
134 | wrap: function(jdel) {
135 | var obj = Object.create(TimeoutStream.prototype, {});
136 | TimeoutStream.apply(obj, arguments);
137 | return obj;
138 | },
139 | unwrap: function(obj) {
140 | return obj._jdel;
141 | }
142 | };
143 | TimeoutStream._create = function(jdel) {
144 | var obj = Object.create(TimeoutStream.prototype, {});
145 | TimeoutStream.apply(obj, arguments);
146 | return obj;
147 | }
148 | module.exports = TimeoutStream;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/util/console.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var formatRegExp = /%[sdj%]/g;
4 |
5 | function format(f) {
6 | if (typeof f !== 'string') {
7 | var objects = [];
8 | for (var index = 0; index < arguments.length; index++) {
9 | objects.push(JSON.stringify(arguments[index]));
10 | }
11 | return objects.join(' ');
12 | }
13 |
14 | if (arguments.length === 1) return f;
15 |
16 | var i = 1;
17 | var args = arguments;
18 | var len = args.length;
19 | var str = String(f).replace(formatRegExp, function(x) {
20 | if (x === '%%') return '%';
21 | if (i >= len) return x;
22 | switch (x) {
23 | case '%s': return String(args[i++]);
24 | case '%d': return Number(args[i++]);
25 | case '%j':
26 | try {
27 | return JSON.stringify(args[i++]);
28 | } catch (_) {
29 | return '[Circular]';
30 | }
31 | // falls through
32 | default:
33 | return x;
34 | }
35 | });
36 | for (var x = args[i]; i < len; x = args[++i]) {
37 | if (x === null || (typeof x !== 'object' && typeof x !== 'symbol')) {
38 | str += ' ' + x;
39 | } else {
40 | str += ' ' + JSON.stringify(x);
41 | }
42 | }
43 | return str;
44 | }
45 |
46 | function Console(stdout, stderr) {
47 | if (!(this instanceof Console)) {
48 | return new Console(stdout, stderr);
49 | }
50 | if (!stdout || !(stdout instanceof java.io.PrintStream)) {
51 | throw new TypeError('Console expects a java.io.PrintStream instance');
52 | }
53 | if (!stderr) {
54 | stderr = stdout;
55 | } else if (!(stderr instanceof java.io.PrintStream)) {
56 | throw new TypeError('Console expects java.io.PrintStream instances');
57 | }
58 |
59 | var prop = {
60 | writable: true,
61 | enumerable: false,
62 | configurable: true
63 | };
64 | prop.value = stdout;
65 | Object.defineProperty(this, '_stdout', prop);
66 | prop.value = stderr;
67 | Object.defineProperty(this, '_stderr', prop);
68 | prop.value = {};
69 | Object.defineProperty(this, '_times', prop);
70 |
71 | // bind the prototype functions to this Console instance
72 | var keys = Object.keys(Console.prototype);
73 | for (var v = 0; v < keys.length; v++) {
74 | var k = keys[v];
75 | this[k] = this[k].bind(this);
76 | }
77 | }
78 |
79 | Console.prototype.log = function() {
80 | this._stdout.println(format.apply(null, arguments));
81 | };
82 |
83 |
84 | Console.prototype.info = Console.prototype.log;
85 |
86 |
87 | Console.prototype.warn = function() {
88 | this._stderr.println(format.apply(null, arguments));
89 | };
90 |
91 |
92 | Console.prototype.error = Console.prototype.warn;
93 |
94 |
95 | module.exports = new Console(java.lang.System.out, java.lang.System.err);
96 | module.exports.Console = Console;
--------------------------------------------------------------------------------
/.vertx/debug-js/vertx-js/worker_executor.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Red Hat, Inc.
3 | *
4 | * Red Hat licenses this file to you under the Apache License, version 2.0
5 | * (the "License"); you may not use this file except in compliance with the
6 | * License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /** @module vertx-js/worker_executor */
18 | var utils = require('vertx-js/util/utils');
19 | var Measured = require('vertx-js/measured');
20 | var Future = require('vertx-js/future');
21 |
22 | var io = Packages.io;
23 | var JsonObject = io.vertx.core.json.JsonObject;
24 | var JWorkerExecutor = Java.type('io.vertx.core.WorkerExecutor');
25 |
26 | /**
27 | An executor for executing blocking code in Vert.x .
28 |
29 | @class
30 | */
31 | var WorkerExecutor = function(j_val) {
32 |
33 | var j_workerExecutor = j_val;
34 | var that = this;
35 | Measured.call(this, j_val);
36 |
37 | /**
38 | Whether the metrics are enabled for this measured object
39 |
40 | @public
41 |
42 | @return {boolean} true if the metrics are enabled
43 | */
44 | this.isMetricsEnabled = function() {
45 | var __args = arguments;
46 | if (__args.length === 0) {
47 | return j_workerExecutor["isMetricsEnabled()"]();
48 | } else throw new TypeError('function invoked with invalid arguments');
49 | };
50 |
51 | /**
52 | Safely execute some blocking code.
53 |
54 | Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.
55 |
56 | When the code is complete the handler resultHandler will be called with the result on the original context
57 | (i.e. on the original event loop of the caller).
58 |
59 | A Future instance is passed into blockingCodeHandler. When the blocking code successfully completes,
60 | the handler should call the {@link Future#complete} or {@link Future#complete} method, or the {@link Future#fail}
61 | method if it failed.
62 |
63 | In the blockingCodeHandler the current context remains the original context and therefore any task
64 | scheduled in the blockingCodeHandler will be executed on the this context and not on the worker thread.
65 |
66 | @public
67 | @param blockingCodeHandler {function} handler representing the blocking code to run
68 | @param ordered {boolean} if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
69 | @param resultHandler {function} handler that will be called when the blocking code is complete
70 | */
71 | this.executeBlocking = function() {
72 | var __args = arguments;
73 | if (__args.length === 2 && typeof __args[0] === 'function' && typeof __args[1] === 'function') {
74 | j_workerExecutor["executeBlocking(io.vertx.core.Handler,io.vertx.core.Handler)"](function(jVal) {
75 | __args[0](utils.convReturnVertxGen(Future, jVal, undefined));
76 | }, function(ar) {
77 | if (ar.succeeded()) {
78 | __args[1](utils.convReturnTypeUnknown(ar.result()), null);
79 | } else {
80 | __args[1](null, ar.cause());
81 | }
82 | });
83 | } else if (__args.length === 3 && typeof __args[0] === 'function' && typeof __args[1] ==='boolean' && typeof __args[2] === 'function') {
84 | j_workerExecutor["executeBlocking(io.vertx.core.Handler,boolean,io.vertx.core.Handler)"](function(jVal) {
85 | __args[0](utils.convReturnVertxGen(Future, jVal, undefined));
86 | }, __args[1], function(ar) {
87 | if (ar.succeeded()) {
88 | __args[2](utils.convReturnTypeUnknown(ar.result()), null);
89 | } else {
90 | __args[2](null, ar.cause());
91 | }
92 | });
93 | } else throw new TypeError('function invoked with invalid arguments');
94 | };
95 |
96 | /**
97 | Close the executor.
98 |
99 | @public
100 |
101 | */
102 | this.close = function() {
103 | var __args = arguments;
104 | if (__args.length === 0) {
105 | j_workerExecutor["close()"]();
106 | } else throw new TypeError('function invoked with invalid arguments');
107 | };
108 |
109 | // A reference to the underlying Java delegate
110 | // NOTE! This is an internal API and must not be used in user code.
111 | // If you rely on this property your code is likely to break if we change it / remove it without warning.
112 | this._jdel = j_workerExecutor;
113 | };
114 |
115 | WorkerExecutor._jclass = utils.getJavaClass("io.vertx.core.WorkerExecutor");
116 | WorkerExecutor._jtype = {
117 | accept: function(obj) {
118 | return WorkerExecutor._jclass.isInstance(obj._jdel);
119 | },
120 | wrap: function(jdel) {
121 | var obj = Object.create(WorkerExecutor.prototype, {});
122 | WorkerExecutor.apply(obj, arguments);
123 | return obj;
124 | },
125 | unwrap: function(obj) {
126 | return obj._jdel;
127 | }
128 | };
129 | WorkerExecutor._create = function(jdel) {
130 | var obj = Object.create(WorkerExecutor.prototype, {});
131 | WorkerExecutor.apply(obj, arguments);
132 | return obj;
133 | }
134 | module.exports = WorkerExecutor;
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Asynchronous Unit Test
2 |
3 | [](https://github.com/vert-x3/vertx-unit/actions/workflows/ci-5.x.yml)
4 | [](https://github.com/eclipse-vertx/vertx-codegen/actions/workflows/ci-4.x.yml)
5 |
6 | Async unit testing for Vert.x.
7 |
8 | ## Documentation
9 |
10 | * [Java documentation](http://vertx.io/docs/vertx-unit/java/)
11 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 |
20 |
21 | io.vertx
22 | vertx5-parent
23 | 12
24 |
25 |
26 | vertx-unit
27 | 5.1.0-SNAPSHOT
28 |
29 | Vert.x Unit
30 |
31 |
32 | scm:git:git@github.com:vert-x3/vertx-unit.git
33 | scm:git:git@github.com:vert-x3/vertx-unit.git
34 | git@github.com:vert-x3/vertx-unit.git
35 |
36 |
37 |
38 |
39 |
40 | io.vertx
41 | vertx-dependencies
42 | ${project.version}
43 | pom
44 | import
45 |
46 |
47 |
48 |
49 |
50 |
51 | io.vertx
52 | vertx-core
53 |
54 |
55 |
56 |
57 | junit
58 | junit
59 | 4.13.1
60 | true
61 |
62 |
63 |
64 | io.vertx
65 | vertx-codegen-api
66 | true
67 |
68 |
69 | io.vertx
70 | vertx-codegen-json
71 | true
72 |
73 |
74 | io.vertx
75 | vertx-docgen-api
76 | true
77 |
78 |
79 | io.vertx
80 | vertx-core
81 | test-jar
82 | test
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | maven-compiler-plugin
92 |
93 |
94 | default-compile
95 |
96 |
97 |
98 | io.vertx
99 | vertx-codegen
100 | processor
101 |
102 |
103 | io.vertx
104 | vertx-docgen-processor
105 | processor
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | maven-resources-plugin
119 |
120 |
121 | default-resources
122 | process-classes
123 |
124 |
125 |
126 |
127 | org.apache.maven.plugins
128 | maven-surefire-plugin
129 |
130 |
131 | 60
132 | PARANOID
133 |
134 |
135 |
136 |
137 | maven-assembly-plugin
138 |
139 |
140 | package-docs
141 |
142 | single
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
--------------------------------------------------------------------------------
/src/main/generated/io/vertx/ext/unit/TestOptionsConverter.java:
--------------------------------------------------------------------------------
1 | package io.vertx.ext.unit;
2 |
3 | import io.vertx.core.json.JsonObject;
4 | import io.vertx.core.json.JsonArray;
5 | import java.time.Instant;
6 | import java.time.format.DateTimeFormatter;
7 |
8 | /**
9 | * Converter and mapper for {@link io.vertx.ext.unit.TestOptions}.
10 | * NOTE: This class has been automatically generated from the {@link io.vertx.ext.unit.TestOptions} original class using Vert.x codegen.
11 | */
12 | public class TestOptionsConverter {
13 |
14 | static void fromJson(Iterable> json, TestOptions obj) {
15 | for (java.util.Map.Entry member : json) {
16 | switch (member.getKey()) {
17 | case "timeout":
18 | if (member.getValue() instanceof Number) {
19 | obj.setTimeout(((Number)member.getValue()).longValue());
20 | }
21 | break;
22 | case "useEventLoop":
23 | if (member.getValue() instanceof Boolean) {
24 | obj.setUseEventLoop((Boolean)member.getValue());
25 | }
26 | break;
27 | }
28 | }
29 | }
30 |
31 | static void toJson(TestOptions obj, JsonObject json) {
32 | toJson(obj, json.getMap());
33 | }
34 |
35 | static void toJson(TestOptions obj, java.util.Map json) {
36 | json.put("timeout", obj.getTimeout());
37 | if (obj.isUseEventLoop() != null) {
38 | json.put("useEventLoop", obj.isUseEventLoop());
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/generated/io/vertx/ext/unit/report/ReportOptionsConverter.java:
--------------------------------------------------------------------------------
1 | package io.vertx.ext.unit.report;
2 |
3 | import io.vertx.core.json.JsonObject;
4 | import io.vertx.core.json.JsonArray;
5 | import java.time.Instant;
6 | import java.time.format.DateTimeFormatter;
7 |
8 | /**
9 | * Converter and mapper for {@link io.vertx.ext.unit.report.ReportOptions}.
10 | * NOTE: This class has been automatically generated from the {@link io.vertx.ext.unit.report.ReportOptions} original class using Vert.x codegen.
11 | */
12 | public class ReportOptionsConverter {
13 |
14 | static void fromJson(Iterable> json, ReportOptions obj) {
15 | for (java.util.Map.Entry member : json) {
16 | switch (member.getKey()) {
17 | case "to":
18 | if (member.getValue() instanceof String) {
19 | obj.setTo((String)member.getValue());
20 | }
21 | break;
22 | case "format":
23 | if (member.getValue() instanceof String) {
24 | obj.setFormat((String)member.getValue());
25 | }
26 | break;
27 | }
28 | }
29 | }
30 |
31 | static void toJson(ReportOptions obj, JsonObject json) {
32 | toJson(obj, json.getMap());
33 | }
34 |
35 | static void toJson(ReportOptions obj, java.util.Map json) {
36 | if (obj.getTo() != null) {
37 | json.put("to", obj.getTo());
38 | }
39 | if (obj.getFormat() != null) {
40 | json.put("format", obj.getFormat());
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/generated/io/vertx/ext/unit/report/ReportingOptionsConverter.java:
--------------------------------------------------------------------------------
1 | package io.vertx.ext.unit.report;
2 |
3 | import io.vertx.core.json.JsonObject;
4 | import io.vertx.core.json.JsonArray;
5 | import java.time.Instant;
6 | import java.time.format.DateTimeFormatter;
7 |
8 | /**
9 | * Converter and mapper for {@link io.vertx.ext.unit.report.ReportingOptions}.
10 | * NOTE: This class has been automatically generated from the {@link io.vertx.ext.unit.report.ReportingOptions} original class using Vert.x codegen.
11 | */
12 | public class ReportingOptionsConverter {
13 |
14 | static void fromJson(Iterable> json, ReportingOptions obj) {
15 | for (java.util.Map.Entry member : json) {
16 | switch (member.getKey()) {
17 | case "reporters":
18 | if (member.getValue() instanceof JsonArray) {
19 | java.util.ArrayList list = new java.util.ArrayList<>();
20 | ((Iterable