FileDocCategorySizeDatePackage
ConvertClient.javaAPI DocExample2567Thu Mar 16 11:52:16 GMT 2000None

ConvertClient

public class ConvertClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        System.setSecurityManager(new RMISecurityManager());

        ServiceFinder sf = new ServiceFinder(TransactionManager.class);
        TransactionManager txm = (TransactionManager)(sf.getObject());

        Transaction.Created resp =
                    TransactionFactory.create(txm, Lease.FOREVER);
        LeaseRenewalManager lrm = new LeaseRenewalManager();
        lrm.renewUntil(resp.lease, Lease.FOREVER, null);

        boolean commit = true;
        try {
            // Do some transaction based operations here, passing
            // resp.transaction to services that need it
        } catch (Exception e) {
            commit = false;
        }

        if (commit)
            resp.transaction.commit();
        else resp.transaction.abort();

        // The transaction lease was cancelled as a side-effect of
        // the commit
        lrm.remove(resp.lease);