Complete Jini client in how many lines…..?
24! Could probably get it a bit shorter but hey…..!
Here it is, this is from the current HEAD of Glyph – from this we can generate configs, service starter startup configs startup scripts, and all the binding to a service…..If you think this is good, you should see what it can do with one of the most painful parts of Jini – Distributed Leasing. With a bit more testing, and clean-up etc, Glyph 0.3 will be shipped
package glyph.test.simple;
import java.rmi.RemoteException;
import net.jini.core.lease.Lease;
import net.jini.core.transaction.TransactionException;
import net.jini.lookup.entry.Name;
import net.jini.space.JavaSpace05;
import org.jini.glyph.Client;
public class TestClient {
@Client
public void writeMyEntry(JavaSpace05 myspace){
try {
Name ne = new Name("Joe Bloggs");
myspace.write(ne, null, Lease.FOREVER);
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TransactionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}




Thanks !