|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.user.UserAgent
lbg.user.LiveUserAgent
public class LiveUserAgent
UserAgent, Live Implementation.
Related logger: lbg.user
Constructor Summary | |
---|---|
LiveUserAgent(java.lang.String id,
java.lang.String host,
int port,
UserPeerHandle peer,
java.lang.String output_dir)
Creates a Live UserAgent. |
|
LiveUserAgent(java.lang.String id,
java.lang.String host,
int port,
UserPeerHandle peer,
java.lang.String output_dir,
java.lang.String stats_dir)
Creates a Live UserAgent. |
|
LiveUserAgent(java.lang.String id,
java.lang.String host,
int port,
UserPeerHandle peer,
java.lang.String output_dir,
java.lang.String stats_dir,
boolean activate_measurement,
boolean save_results)
Creates a Live UserAgent. |
Method Summary | |
---|---|
long |
completedJobs()
|
boolean |
hasRunningJobs()
|
java.lang.String |
host()
Get user host |
boolean |
isAlive()
|
void |
notifyCompletedJob(Task t)
Notifies a User that the last Task of a Job has been completed. |
void |
notifyCompletedTask(Task t)
Notifies a User that a Task has been completed. |
int |
port()
Get user port |
void |
registerListener(LiveUserAgentListener listen)
Register this object as a listener. |
UserService |
service()
|
void |
startService()
|
void |
startService(boolean set_daemon)
|
int |
submitJob(JobDescriptor jd)
Submits a Job. |
long |
submittedJobs()
|
java.lang.String |
toString()
String representation of the User. |
void |
unRegisterListener(LiveUserAgentListener listen)
Unregister this object as a listener. |
Methods inherited from class lbg.user.UserAgent |
---|
id, usedPeer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LiveUserAgent(java.lang.String id, java.lang.String host, int port, UserPeerHandle peer, java.lang.String output_dir, java.lang.String stats_dir) throws GridException
Measurements are activated by default.
Output data files are saved by default.
id
- User IDhost
- User host (to contact him from the outside)port
- User port (local)peer
- Parent peeroutput_dir
- The path of a directory where files will be
output. Filenames will be of the form
[user_id].[peer_id].job[jobID].bot[botID].task[taskID].dat
stats_dir
- The path of a directory where job runtime stats will be
saved
GridException
- if the parameters are erroneouspublic LiveUserAgent(java.lang.String id, java.lang.String host, int port, UserPeerHandle peer, java.lang.String output_dir) throws GridException
Measurements are deactivated by default.
Output data files are not saved by default.
id
- User IDhost
- User host (to contact him from the outside)port
- User port (local)peer
- Parent peeroutput_dir
- The path of a directory where files will be
output. Filenames will be of the form
[user_id].[peer_id].job[jobID].bot[botID].task[taskID].dat
GridException
- if the parameters are erroneouspublic LiveUserAgent(java.lang.String id, java.lang.String host, int port, UserPeerHandle peer, java.lang.String output_dir, java.lang.String stats_dir, boolean activate_measurement, boolean save_results) throws GridException
id
- User IDhost
- User host (to contact him from the outside)port
- User port (local)peer
- Parent peeroutput_dir
- The path of a directory where files will be
output. Filenames will be of the form
[user_id].[peer_id].job[jobID].bot[botID].task[taskID].dat
stats_dir
- The path of a directory where job runtime stats will be
savedactivate_measurement
- true if Measurements should be activatedsave_results
- true to save results to disk
GridException
- if the parameters are erroneousMethod Detail |
---|
public java.lang.String toString()
toString
in class UserAgent
public UserService service()
service
in class UserAgent
public java.lang.String host()
public int port()
public void registerListener(LiveUserAgentListener listen)
listen
- The object that wants to be aware of our actions.public void unRegisterListener(LiveUserAgentListener listen)
listen
- The object that doesn't want to be aware of our actions
anymore.public void notifyCompletedTask(Task t) throws GridException
notifyCompletedTask
in class UserAgent
t
- completed Task
GridException
- if User failed to save output data filepublic void notifyCompletedJob(Task t) throws GridException
notifyCompletedJob
in class UserAgent
t
- completed Task
GridException
- if User failed to save output data filepublic int submitJob(JobDescriptor jd) throws GridException
submitJob
in class UserAgent
jd
- descriptor of the Job to submit
GridException
- if a Job with the same id has already been sentpublic long submittedJobs()
submittedJobs
in class UserAgent
public long completedJobs()
completedJobs
in class UserAgent
public boolean hasRunningJobs()
hasRunningJobs
in class UserAgent
public boolean isAlive()
public void startService() throws GridException
GridException
public void startService(boolean set_daemon) throws GridException
GridException
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.