Changes

Jump to: navigation, search

Teams Winter 2011/team6/lab2

727 bytes added, 13:43, 12 April 2011
no edit summary
::
a) import java.util.Calendar;
import java.util.Date;
import cs.dps914.osgi.lab.chatinterface.IMessage;
.3 Export the Package - To register our service we must export the package into the interface bundlepublic class SimpleMessage implements IMessage {
a private String source; private Date time; private String message; public SimpleMessage(String src,String msg) { setSource(src); setTime(Calendar.getInstance() Select the MANIFEST.MFgetTime()); setMessage(msg); } public void setSource(String src) { if (src!=null) { source=src; } else { source=""; } }
public String getSource() {
return source;
}
public void setTime(Date time) {
if (time!=null) {
this.time=time;
} else {
this.time=Calendar.getInstance().getTime();
}
}
 
public Date getTime() {
return time;
}
 
public void setMessage(String msg) {
if (msg!=null) {
message=msg;
} else {
message="";
}
}
 
public String getMessage() {
return message;
}
}
b) In the Runtime tab select Add
1
edit

Navigation menu