FileDocCategorySizeDatePackage
ConvertServiceRegistrationImpl.javaAPI DocExample2822Thu Mar 16 11:52:16 GMT 2000None

ConvertServiceRegistrationImpl

public class ConvertServiceRegistrationImpl extends Object implements Serializable, ConvertServiceRegistration

Fields Summary
private JavaSpace
js
private Lease
lease
Constructors Summary
public ConvertServiceRegistrationImpl(JavaSpace js, Lease l)

        this.js = js;
        this.lease = l;
    
Methods Summary
public java.lang.Stringconvert(int i)


        try {
            // See if there's a cached result (done == true) already
            Conversion request = new Conversion(5, true);
            Conversion result = (Conversion) js.read(request, null, JavaSpace.NO_WAIT);
            if (result == null) {
                // There was no cached result. Make a new request and retrieve
                // that answer
                request.done = new Boolean(false);
                js.write(request, null, Lease.FOREVER);
                request.done = new Boolean(true);
                result = (Conversion) js.read(request, null, Long.MAX_VALUE);
            }
            // else just use the cached value

            return result.result;
        } catch (Exception e) {
            throw new RemoteException("convert", e);
        }
    
public LeasegetLease()

        return lease;