Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Deutsch) » UltraLiteJ » UltraLiteJ-Referenz » UltraLiteJ API-Referenz

 

SyncObserver-Schnittstelle

Empfängt Informationen zum Synchronisationsfortschritt

Syntax
public SyncObserver
Bemerkungen

Um Verarbeitungsfortschrittsberichte während der Synchronisation zu erhalten, müssen Sie eine neue Klasse erstellen, die diese Aufgabe durchführt, und sie implementieren, indem Sie die setSyncObserver-Funktion verwenden.

Das folgende Beispiel illustriert eine einfache SyncObserver-Schnittstelle:

class MyObserver implements SyncObserver {
    public boolean syncProgress(int state, SyncResult result) {
        System.out.println(
            "sync progress state = " + state
            + " bytes sent = " + result.getSentByteCount()
            + " bytes received = " + result.getReceivedByteCount()
        );
        return false;   // Always continue synchronization.
    }
    public MyObserver() {} // The default constructor.
}

Die obenstehende Observer-Klasse wird folgendermaßen aktiviert:

// J2ME Sample
Connection conn;
ConfigRecordStore config = DatabaseManager.createConfigurationRecordStore(
    "test.ulj"
    );
try {
    conn = DatabaseManager.connect(config);
} catch(ULjException ex) {
    conn = DatabaseManager.createDatabase(config);
    // Create the schema here.
}
SyncParms.setSyncObserver(new MyObserver());
Mitglieder

Alle Mitglieder von SyncObserver, einschließlich aller geerbten Mitglieder.


syncProgress-Methode