forked from joeferner/node-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava.h
More file actions
43 lines (32 loc) · 882 Bytes
/
Copy pathjava.h
File metadata and controls
43 lines (32 loc) · 882 Bytes
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
#ifndef _node_java_h_
#define _node_java_h_
#include <v8.h>
#include <node.h>
#include <jni.h>
class NewInstanceBaton;
class Java : public node::ObjectWrap {
public:
static void Init(v8::Handle<v8::Object> target);
friend class NewInstanceBaton;
private:
Java();
~Java();
static JNIEnv* createJVM();
static v8::Handle<v8::Value> New(const v8::Arguments& args);
static v8::Handle<v8::Value> newInstance(const v8::Arguments& args);
static void EIO_NewInstance(eio_req* req);
static int EIO_AfterNewInstance(eio_req* req);
static v8::Persistent<v8::FunctionTemplate> s_ct;
JNIEnv* m_env;
};
class NewInstanceBaton {
public:
NewInstanceBaton(Java* java, const char *className, v8::Handle<v8::Value> &callback);
~NewInstanceBaton();
void doCallback();
private:
Java* m_java;
v8::Persistent<v8::Value> m_callback;
char* m_className;
};
#endif