• Post Reply Bookmark Topic Watch Topic
  • New Topic

javaspace notify  RSS feed

hari vijayadharan
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I am new to javaspaces. I tried out a sample program using notify function, some parts of code as follows.

//Inside registar class has method register which invokes NOTIFY() in JAVASPACE

public void register() throws Exception {
theListener = new EventListener();
theManager = new LeaseRenewalManager();

EventRegistration myReg = theSpace.notify(new ArrayMetaData(), null,
new MarshalledObject(new Integer(12345)));

theManager.renewFor(myReg.getLease(), Lease.FOREVER,
30000, new DebugListener());


//and a notify method in a class EventListner which implements RemoteEventListener

EventListener() throws RemoteException {
System.out.println("Inside Eventlistner constructor");
Exporter myDefaultExporter =
new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
new BasicILFactory(), false, true);

theStub = (RemoteEventListener) myDefaultExporter.export(this);

//getstub method - 3rd parameter to notify..

RemoteEventListener getStub() {
return theStub;

public void notify(RemoteEvent anEvent) {

try {
System.out.println("I got event");
System.out.println("Got event: " + anEvent.getSource() + ", " +
anEvent.getID() + ", " +
anEvent.getSequenceNumber() + ", " +

System.out.println("Some one wrote ArrayMetaDATA");

} catch (Exception anE) {
System.out.println("Got event but couldn't display it");

This notify is working for only some writes of 'ArrayMetaData' Entry Objects... and for some the notify does not respond. Is there any way in which we can make notify 100% reliable.

Thanking in advance..
Amit Ghorpade
Posts: 2856
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"harikrishnan " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!