Transcript JAPC
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
Interface – basic abstractions
JAPC extensions
ParameterMetafactory
Summary
24th April 2013
JAPC im a Nutshell
2
What is JAPC ?
JAPC is a unified API for all different kinds of
parameters present in CERN control system
JAPC = CORE + extensions + services
24th April 2013
JAPC im a Nutshell
3
JAPC: overal architecture
Java Control
Programs
GUI Components
General Purpose
Services
Diagnostic Tools
JAPC API
CMW directory
service
JAPC CORE
japc-ext-cmwrda2
Configuration
Database
CCDB
japc-ext-sim
24th April 2013
japc-ext-tgm
japc-ext-reference
RDA devices
japc-ext-remote
japc-ext-mockito
japc-ext-sim
SNMP devices
japc-ext-snmp
japc-ext-cmwrda3
Databases
JAPC im a Nutshell
JMS
4
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 functionality provided by JAPC:
SET/GET and 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
24th April 2013
JAPC im a Nutshell
5
JAPC: Implementation of Diverse Parameters
Specfic
applications
GUI
components
Diagnostic
Tools
General
Purpose
Services
JAPC Interface
Parameter
----------------------------set()
get()
subscribe()
CMW Parameter
----------------------------set()
get()
subscribe()
DB Parameter
----------------------------set()
get()
subscribe()
Controls
Middleware
Database
24th April 2013
JAPC CORE
HW Devices
(Front-ends)
Simulated
parameters
Virtual Devices
(J2EE Server)
Database
or Files
Timing
System
TIMING Parameter
----------------------------set()
get()
subscribe()
JAPC im a Nutshell
6
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)
CycleSelector specifies 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
24th April 2013
JAPC im a Nutshell
7
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
24th April 2013
JAPC im a Nutshell
8
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
Metafactory knows what 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
24th April 2013
JAPC im a Nutshell
9
JAPC: summary
Clients at CERN
Many projects: 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 various dependencies
Some numbers
JAPC core: 350 Classes, 60’000 Lines of Code;
12 extensions: each 10-20 Classes, 1’000-3’000 Lines of Code
24th April 2013
JAPC im a Nutshell
10