A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a cache on Host.name. Add a cache on some jfieldID/jmethodID on Host/Process
[simgrid.git]
/
org
/
simgrid
/
msg
/
Host.java
diff --git
a/org/simgrid/msg/Host.java
b/org/simgrid/msg/Host.java
index
8e09849
..
905596d
100644
(file)
--- a/
org/simgrid/msg/Host.java
+++ b/
org/simgrid/msg/Host.java
@@
-50,7
+50,10
@@
public class Host {
* @see Host.getByName().
*/
public long bind;
* @see Host.getByName().
*/
public long bind;
-
+ /**
+ * Host name
+ */
+ private String name;
/**
* User data.
/**
* User data.
@@
-80,7
+83,7
@@
public class Host {
* This static method returns the count of the installed hosts.
*
* @return The count of the installed hosts.
* This static method returns the count of the installed hosts.
*
* @return The count of the installed hosts.
- * FIXME: Not implemented.
.. ?
+ * FIXME: Not implemented.
*/
public native static int getCount();
*/
public native static int getCount();
@@
-97,28
+100,25
@@
public class Host {
* @return An array containing all the hosts installed.
*
*/
* @return An array containing all the hosts installed.
*
*/
- public static Host[] all() {
- return MsgNative.allHosts();
- }
+ public native static Host[] all();
/**
* This method returns the name of a host.
/**
* This method returns the name of a host.
- *
* @return The name of the host.
*
*/
* @return The name of the host.
*
*/
- public native String getName();
+ public String getName() {
+ return name;
+ }
/**
* Sets the data of the host.
/**
* Sets the data of the host.
- *
- *
* @param data
*/
public void setData(Object data) {
this.data = data;
}
/**
* @param data
*/
public void setData(Object data) {
this.data = data;
}
/**
- * Gets the data of the host.
+ * Gets the d
ata of the host.
*
* @return
*/
*
* @return
*/
@@
-157,5
+157,11
@@
public class Host {
*/
public native boolean isAvail();
*/
public native boolean isAvail();
-
+ /**
+ * Class initializer, to initialize various JNI stuff
+ */
+ public static native void nativeInit();
+ static {
+ nativeInit();
+ }
}
}