Skip to content

S2 SICS Client_128843981

nxi edited this page Apr 9, 2015 · 1 revision
Created by Tony Lam, last modified on Jul 15, 2010

Introduction

This paper describe the design of the new SICS adaptor in GumTree, codename S2.

Design

Architecture
  • Split into 4 tiers:
    • I/O (used by any Java client) - org.gumtree.cs.sics.io
    • CORE (work under OSGi runtime)- org.gumtree.cs.sics.core
    • UI (SWT) - org.gumtree.sics.ui.swt
    • workbench (GumTree workbench version) - org.gumtree.sics.ui.workbench
  • Use bean convention if possible to support configuration over Spring
IO:
  • Can be used in pure Java program
  • Easily stop and replace channel
  • Recover connection error (auto-reconnect)
Core:
  • Two essential platform level services:
    • Sics client and sics event bus
  • Service orientated design, with available internal services:
    • Connection Manager
    • Model Provider
    • Component Manager
    • Persistence Manager
    • Monitor Service
    • Batch Buffer Manager
  • Check SICS version for compatibility (GUMTREE-22)
  • Cooperate with SICS state ID (for discrepancy checking)
  • Better support for scripting
  • Role support
  • Manual / auto reconnection (GUMTREE-327)
  • Report and propagate error immediately on failed motor drive
  • Swapping component factory
  • Customising component factory via Spring
  • Remote service support
  • ReST support
  • Persist all transactions for record and replay
UI:
  • Dashboard support
  • Generative UI? (GUMTREE-47)
  • Allow device controller swap in and out
Workbench:
  • Use XViewer for sorting and filering (GUMTREE-14)
  • Role filtering

API Usage

SICS I/O

Connect to a SICS server
ISicsConnector connector = new SicsConnector("test");
IConnectionContext context = ConnectionContext.createContext(HOST, PORT, "spy", PASSWORD);
connector.setConnectionContext(context);
connector.connect();
Set privilege on the connection
connector.setRights(SicsRole.SPY, PASSWORD);
Disconnect from a SICS server (connector can be reconnected later)
connector.disconnect();
Dispose a connector (no more reconnection can be performed)
connector.dispose();
Send messages on a connected connector
// Synchronous send (get user id)
ISicsResponse[] responses = connector.syncRequest("user");
// Synchronous send (set user id)
connector.syncRequest("user me");
// Asynchronous send (get user id)
connector.asyncRequest("user", new SicsRequestCallback() {
    public void receiveReply(ISicsResponse response) {
        responseText[0] = response.getDataString();
        setCallbackCompleted(true);
    }
});

SICS Core

Get SICS client
// From facade:
ISicsClient sicsClient = SicsCore.getSicsClient()
// Or directly from the service registry
sicsClient = GTPlatform.getService(ISicsClient.class)
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally