javaspace notify
SUBSCRIBE JAVASPACES-USERS Anonymous <[email protected]> Thu, 12 Mar 2009 00:33:33 -0600
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
hi all,
I am new to javaspaces. I tried out a sample program using notify functio=
n,
some parts of code as follows.
//Inside registar class has method register which invokes NOTIFY() in JAV=
ASPACE
public void register() throws Exception {
theListener =3D new EventListener();
theManager =3D new LeaseRenewalManager();
EventRegistration myReg =3D theSpace.notify(new ArrayMetaData(), null,
theListener.getStub(),
30000,
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
//EVENTLISTNER CONSTRUCTOR
EventListener() throws RemoteException {
System.out.println("Inside Eventlistner constructor");
Exporter myDefaultExporter =3D
new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
new BasicILFactory(), false, true);
theStub =3D (RemoteEventListener) myDefaultExporter.export(this);
}
//getstub method - 3rd parameter to notify..
RemoteEventListener getStub() {
return theStub;
}
//NOTIFY METHOD IN EVENTLISTNER
public void notify(RemoteEvent anEvent) {
try {
System.out.println("I got event");
System.out.println("Got event: " + anEvent.getSource() + ", " +
anEvent.getID() + ", " +
anEvent.getSequenceNumber() + ", " +
anEvent.getRegistrationObject().get());
System.out.println("Some one wrote ArrayMetaDATA");
} catch (Exception anE) {
System.out.println("Got event but couldn't display it");
anE.printStackTrace(System.out);
}
}
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..
Hari
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html