+ All Categories
Home > Documents > Paul Scherrer Institute

Paul Scherrer Institute

Date post: 29-Jan-2016
Category:
Upload: talmai
View: 45 times
Download: 0 times
Share this document with a friend
Description:
Simon Gregor Ebner. Paul Scherrer Institute. JCA Extensions. PSI,. 22. August 2014. Contents. Introduction Why JCA-E Architecture Examples Outlook. PSI,. 22. August 2014. Motivation. While using JCA, there are many things that can be done wrong … - PowerPoint PPT Presentation
Popular Tags:
11
15. Juni 2022 PSI, 15. Juni 2022 PSI, Paul Scherrer Institute JCA Extensions Simon Gregor Ebner
Transcript
Page 1: Paul Scherrer Institute

22. April 2023PSI, 22. April 2023PSI,

Paul Scherrer Institute

JCA Extensions

Simon Gregor Ebner

Page 2: Paul Scherrer Institute

22. April 2023PSI,

• Introduction• Why JCA-E• Architecture• Examples• Outlook

Contents

22. April 2023PSI, Seite 2

Page 3: Paul Scherrer Institute

• While using JCA, there are many things that can be done wrong …• Need to know details about the Channel Access protocol• Need to open/close channels, set/get values, monitor, … (flushIO/pendIO)• Need to know how to use JCA/CAJ libraries in a single/multithreaded environments• Lots of duplicated code (unless developer creates utility classes)

Motivation

22.04.23PSI, Seite 3

Page 4: Paul Scherrer Institute

• Simplification• Additional layer of abstraction• Developer can think in pure Object Oriented Java• All you have to know is monitored/non monitored

• Ease of use• Use of annotations to facilitate development• Provides easy way to hook functions to channel monitors• Facilitates GUI programming while providing events• No need of type conversions due to the use of Java Generics

• Optimization• Eliminates duplicated code in Java applications• One can transparently benefit from improvements in the JCA-E library

JCA-E Benefits

22.04.23PSI, Seite 4

Page 5: Paul Scherrer Institute

JCA-E Architecture

22.04.23PSI, Seite 5

CAJCAJ

JCAJCA

Channel AccessChannel Access

JCA ExtensionsJCA Extensions

ApplicationApplication

CAJCAJ

JCAJCA

Channel AccessChannel Access

ApplicationApplication

Page 6: Paul Scherrer Institute

JCA-E Architecture / Components

22.04.23PSI, Seite 6

Factory ClassesFactory Classes

ApplicationApplication

Context FactoryContext Factory

Channel FactoryChannel Factory

Channel Bean FactoryChannel Bean Factory

Ca Bean ManagerCa Bean Manager

Channel BeanChannel Bean

AnnotationsAnnotations

Ca BeanCa Bean

JCAJCA

jca.properties

jca.properties

Page 7: Paul Scherrer Institute

// Retrieve channel bean factory

ChannelBeanFactory factory = ChannelBeanFactory.getFactory();// Create channel bean

ChannelBean<String> bean = factory.createChannelBean(String.class, “MYCHANNEL:XYZ”, true);

// Get value

String value = bean.getValue();// Set value

bean.setValue(“hello”);// Wait for a specific value

bean.waitForValue(“world”, 10000);

// Register a function to the monitor

bean.addMonitorListener(this, this.getClass().getMethod(“doIt”));// Register an object as PropertyChangeListener

bean.addPropertyChangeListener(listener);

// Destroy bean / close channel

bean.destroy();

Use Case / Example 1 – Channel Bean

22.04.23PSI, Seite 7

Page 8: Paul Scherrer Institute

// Specify CaBean

public class TestBean{@CaChannel(name=“.ACQT”, type=String.class, monitor=true)private ChannelBean<String> type@CaChannel(name={“.ONE”, “.TWO”, “.THREE”},

type=Double.class, monitor=true)private List<ChannelBean<Double>> values;

// Getter and Setters … etc.

}

// Use Ca Bean

CaBeanManager manager = new CaBeanManager();TestBean tbean = new TestBean();manager.manage(tbean, “PREFIX”);

// Work with Ca Bean

tbean.getType().getValue();

Use Case / Example 2 – Annotations

22.04.23PSI, Seite 8

Page 9: Paul Scherrer Institute

Use Case / Example 3

22.04.23PSI, Seite 9

http://people.web.psi.ch/ebner/wordpress

Page 10: Paul Scherrer Institute

• JCA-E need to be reviewed by JCA experts / community • Further improvements like:• Optimizations …• Include alarm states in Channel Bean class

• Documentation• …

Outlook

22.04.23PSI, Seite 10

Page 11: Paul Scherrer Institute

… Questions …… Suggestions …

… Remarks …… Feedback …

… Ideas …

[email protected]

Questions

22.04.23PSI, Seite 11


Recommended