100 likes | 292 Views
JAPC – Java API For Parameter control in a nutshell 24 th april 201 3. Wojciech Buczak, Wojciech Sliwinski BE-CO-IN for the Middleware team Vito Baggiolini, Roman Gorbonosov BE-CO-DA. Agenda. What is JAPC ? Overal achitecture Core functionality Implementation of Diverse Parameters
E N D
JAPC – Java API For Parameter controlin a nutshell24thapril 2013 Wojciech Buczak, Wojciech SliwinskiBE-CO-IN • for the Middleware team Vito Baggiolini, Roman Gorbonosov BE-CO-DA
Agenda • What is JAPC ? • Overal achitecture • Core functionality • Implementation of Diverse Parameters • Interface – basic abstractions • JAPC extensions • ParameterMetafactory • Summary JAPC im a Nutshell
What is JAPC ? JAPC is a unified API for all different kinds of parameters present in CERN control system JAPC = CORE + extensions + services JAPC im a Nutshell
JAPC: overal architecture Diagnostic Tools GUI Components General Purpose Services Java Control Programs CMW directory service JAPC API JAPC CORE japc-ext-cmwrda2 japc-ext-remote japc-ext-snmp japc-ext-sim japc-ext-tgm japc-ext-mockito japc-ext-reference japc-ext-sim japc-ext-cmwrda3 Configuration Database CCDB RDA devices JMS SNMP devices Databases JAPC im a Nutshell
JAPC: core functionality • JAPC: “Java API for Parameter Control” • Parameter a value you need to supervise and/or control (aka control value, I/O point, I/O channel, signal, device property) Hardware, timing, remote server, db, alarms, simulation, ??.. • Core functionalityprovided by JAPC: • SET/GETand MONITOR > Synchronous and asynchronous operations > Timing-dependent and periodic actions • Obtain meta-information about the parameter • Processing and changing a parameter value on-the-fly • Grouping information from several parameters into a single value JAPC im a Nutshell
JAPC Interface General Purpose Services Specfic applications GUI components Diagnostic Tools JAPC CORE HW Devices (Front-ends) Simulatedparameters Virtual Devices (J2EE Server) Database or Files Timing System JAPC: Implementation of Diverse Parameters Parameter ----------------------------- set() get() subscribe() CMW Parameter ----------------------------- set() get() subscribe() DB Parameter ----------------------------- set() get() subscribe() TIMING Parameter ----------------------------- set() get() subscribe() Database Controls Middleware JAPC im a Nutshell 6
JAPC Interface – basic abstractions • Parameter = the “handle” • provides set/get and subscribe functionality • ParameterValue= Data container • Transports all data types supported by our front-ends • Simple types (byte, int, double, String, etc) arrays, enums • Composite types (contain several simple types) • CycleSelectorspecifies when data shall be accessed • Cycle-Event: timing system event at which the data shall be acquired • Descriptor provides meta information on the parameter • for self-configuring GUI components • getDescription() • isWritable(), isReadable(), isSubscribable() • Information retrieved from CERN directory service • ParameterFactory • a class that knows how to create parameters JAPC im a Nutshell
JAPC: extensions • Many extensions (plugins) available, with the most commonly used: • JAPC remoting extension (japc-ext-remote) • Used to represent middle-tier servers as virtual devices and/or parameters • provides set/get and subscribe functionality • Supports GET/SET/MONITOR operations using serveral remoting technologies (RMI/HTTP/JMS) • Parameter configuration storred in a JAPC registry • JAPC device access extension (japc-ext-cmwrda) • Used to access hardware devices and represent them as a collection of parameters. • Access done through Common Middleware (CMW) • All basic operations supported (GET/SET/MONITOR) • Optimization: support of array-calls • New extensions can eaisily be written on demand JAPC im a Nutshell
JAPC: Metafactory • Part of JAPC core • Client programs use a Factory to create parameters • Before: only one type of devices in a JVM • Now: combination of all devices • Metafactoryknowswhat type of parameter to create • Naming prefixes: protocol://service/device/property#field e.g. • jms://cngs/CNGS.TBID/Acquisition#counts • Name-to-service resolvers • One resolver per known type of parameter • Factory asks each resolver if it knows the parameter name • No protocol://service prefix needed • Example: directory service for RDA JAPC im a Nutshell
JAPC: summary • Clientsat CERN • Manyprojects: LSA, INCA, CNGS, CESAR, Oasis, DIAMON, TIM WorkingSets/Knobs • Is there a project at CERN that does not use JAPC ?? • Easily extendable – plugin architecture • Dependencies • JAPC CORE: NONE • extensions have variousdependencies • Somenumbers • JAPC core: 350 Classes, 60’000 Lines of Code; • 12 extensions: each 10-20 Classes, 1’000-3’000 Lines of Code JAPC im a Nutshell