30
Control Room Accelerator Physics Day 1 Introduction to Open XAL

Introduction to Open XAL

Embed Size (px)

Citation preview

Page 1: Introduction to Open XAL

Control Room Accelerator Physics

Day 1 Introduction to Open XAL

Page 2: Introduction to Open XAL

Overview

2

Open XAL is an extensible application framework for developing accelerator physics applications, scripts and services.

Page 3: Introduction to Open XAL

Collaboration

3

Open XAL is a collaboration among SNS, CSNS, ESS, GANIL, TRIUMF and FRIB.

Page 4: Introduction to Open XAL

Official Website

4

http://xaldev.sourceforge.net

Page 5: Introduction to Open XAL

Features • Open Source collaboration with dozens of developers across several sites

• Pure Java for cross platform development and deployment

• Application Framework for rapidly developing modern applications

• Toolbox of Java packages • Collection of applications (over four dozen) and services

• EPICS Channel Access support • Ant based build system independent of IDE

5

Page 6: Introduction to Open XAL

Development Requirements

•  Java J2SE 7 with JDK • Git 1.7.5 • Ant 1.8

6

6

Page 7: Introduction to Open XAL

Runtime Requirements

•  Java J2SE 7 •  JRuby 1.6 (for JRuby scripts) •  Jython 2.1 (for Jython scripts) • EPICS Channel Access client libraries (optional -

native Channel Access)

7

7

Page 8: Introduction to Open XAL

Reference Release Source Code Anonymous Access

8

git clone http://git.code.sf.net/p/xaldev/openxal

Raw / IDE Independent

git clone http://git.code.sf.net/p/xaldev/project.eclipse

Eclipse Configured

git clone http://git.code.sf.net/p/xaldev/project.xcode

Xcode Configured

Page 9: Introduction to Open XAL

Primary Constructs

9

Construct Description

Core Common Open XAL library

Extension Optional addition to the Core, Core has no dependency

Plugin One of each type of plugin is required by Core at runtime

Service Runs continuously, headless, includes extension

Application Launched by user, Graphical Interface

Script JRuby or Jython based script which may have an graphical interface

Page 10: Introduction to Open XAL

Core Overview • Common packages shared across sites

•  Online Accelerator Physics Model •  Accelerator Object Graph •  Channel Access abstraction •  Database abstraction •  Messaging •  Concurrency Dispatch •  Math packages

10

10

Page 11: Introduction to Open XAL

Project Layout - Core

11

core

build.xml

extensions

config

build

apps

plugins

scripts

services

test

build.xml

resources

lib

src

test

Ant Build File

External Libraries

Images, properties, etc.

Java Source Code

JUnit Tests

Page 12: Introduction to Open XAL

Extension Overview •  Mechanism to add capabilities to Open XAL without

changing the core •  May depend on core, extensions and plugins •  Core has no dependency on extensions •  Apps and Services may depend on extensions •  May include libraries, resources and source code

•  Included libraries (e.g. jmdns) should be completely wrapped by their extension

•  Two types •  Pure •  Service

12

Page 13: Introduction to Open XAL

Pure Extension • Placed under top level extensions directory • Examples: application (framework), bricks (runtime), fit,

scan, solver, service (framework), widget • Package prefix: xal.extension.<extension-name>

13

13

Page 14: Introduction to Open XAL

Service Extension • Associated with a service • A service’s protocol is an extension • A service’s other supporting code may be an extension • Placed at extensions directory under its service’s

directory • Package prefix: xal.service.<service-name> • Example: pvlogger

14

14

Page 15: Introduction to Open XAL

Project Layout - Pure Extensions

15

extensions

core

build.xml

config

build

apps

plugins

scripts

services

test

resources

src

application

build.xml

bricks

extlatgen

fit

orbit

scan

service

Page 16: Introduction to Open XAL

Plugin Overview •  Mechanism to provide custom implementation for some

abstracted core components (e.g. Channel) •  May depend on core, extensions and plugins •  Core has runtime only dependency on plugin families •  Apps and Services may depend directly on plugins •  May include libraries, resources and source code

•  Libraries should be completely wrapped (e.g. jca)

•  Two types •  Solitary •  Family Member

16

Page 17: Introduction to Open XAL

Solitary Plugin • Only one plugin for a given family may be included • Core references a plugin family class to be implemented

by just one plugin (e.g. channel factory) •  Two source code package prefixes to supply (abstract and

implementation) •  xal.<core package tree> •  xal.plugin.<plugin-name>

• Example JCA Plugin

17

17

Page 18: Introduction to Open XAL

Family Member Plugin • Multiple plugins for a given family may be included • Core references a plugin family indirectly through

configuration files (e.g. database configuration) • One source code package prefix to supply

•  xal.plugin.<plugin-name>

• Database Adaptor Plugins •  oracle, mysql

18

18

Page 19: Introduction to Open XAL

Project Layout - Plugins

19

plugins

extensions

core

build.xml

config

build

apps

scripts

services

test Readme.html

jca

mysql

oracle

xal

ca

plugin

src

lib

Page 20: Introduction to Open XAL

Services Overview • Headless executable • Runs 24/7 • Supports multiple clients via remote messages using the

service framework

20

20

Page 21: Introduction to Open XAL

Project Layout - Services

21

services

plugins

extensions

core

build.xml

config

build

apps

scripts

test

build.xml

pvlogger

mpstool

common.xml

build.xml

extension

src

Page 22: Introduction to Open XAL

Applications Overview • Executable with a user interface • Built upon the application framework •  Inherits a common extensible menubar • Shares a common look and feel • Model - View - Controller architecture

22

22

Page 23: Introduction to Open XAL

Project Layout - Applications

23

apps

services

plugins

extensions

core

build.xml

config

build

scripts

test

build.xml

bricks

dbbrowser

common.xml

build.xml

resources

src

extlatgenerator

Page 24: Introduction to Open XAL

Scripts Overview •  JRuby or Jython Script • May have a graphical user interface • Allows for rapid development and testing

24

24

Page 25: Introduction to Open XAL

Project Layout - Scripts

25

scripts

apps

services

plugins

extensions

core

build.xml

config

build

test

build.xml

waveform_monitor

gui.bricks

waveform-monitor.rb

Page 26: Introduction to Open XAL

Default Build Phases

26

Core Extensions Service Extensions Plugins

Service

Application

...

...

Page 27: Introduction to Open XAL

Build Directory Hierarchy

27

Build dist

doc

intermediates

products

apps

lib

scripts

services

Page 28: Introduction to Open XAL

Build Options • You can build everything at the top level by simply typing:

ant • You can get the available build options by typing: ant help • Each absolutely independent component has its own

build file •  At component root, simply type: ant •  You can build an individual application •  You cannot build an individual extension

28

28

Page 29: Introduction to Open XAL

29

> ant help !

Buildfile: /Users/t6p/Projects/OpenXAL/Development/Base/openxal/build.xmlhelp: [echo] Build the XAL project [echo] Usage: ant [ant options] target1 [target2 | target3 | ... ] [echo] [echo] where target(s) can be: [echo] help ....................... Print this message. [echo] all ........................ Build the XAL core, services and applications. Copy scripts to the build directory. [echo] apps ....................... Compile the applications and assemble the jar products. [echo] clean ...................... Clean compiled classes and build products [echo] core ....................... Compile the core XAL classes and assemble the jar products. [echo] doc ........................ Build the javadoc for the core, extensions and plugins. [echo] info ....................... Post build information. [echo] install .................... Install all build products which allow batch installation. [echo] install-apps ............... Install all apps which allow batch installation. [echo] install-doc ................ Install the javadoc. [echo] install-scripts ............ Install all scripts. [echo] install-services ........... Install all services which allow batch installation. [echo] install-shared ............. Install the core. [echo] jar-resources .............. Archive resources for the core plus all batch enabled applications and services. [echo] purge-build ................ Purge all build products. [echo] purge-install .............. Purge all installed products. [echo] purge-intermediates ........ Purge the build intermediates. !

Top Level Build Options

Page 30: Introduction to Open XAL

30

[echo] purge-shared-intermediates . Purge the shared build intermediates. [echo] run-tests .................. Build and run unit tests. [echo] scripts .................... Copy scripts to the build directory. [echo] services ................... Compile the services and assemble the jar products. [echo] shared ..................... Build the shared library including the core and any extensions and plugins. [echo] standalone-apps ............ Build the applications which allow batch building and assemble the jar products as standalone applications. [echo] standalone-services ........ Build the services which allow batch building and assemble the jar products as standalone services. !

Top Level Build Options Continued