-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4119838
commit 5b7e091
Showing
13 changed files
with
3,765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>core-pv-jackie</artifactId> | ||
<parent> | ||
<groupId>org.phoebus</groupId> | ||
<artifactId>core</artifactId> | ||
<version>4.7.4-SNAPSHOT</version> | ||
</parent> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>${junit.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-all</artifactId> | ||
<version>1.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.epics</groupId> | ||
<artifactId>vtype</artifactId> | ||
<version>${vtype.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.phoebus</groupId> | ||
<artifactId>core-framework</artifactId> | ||
<version>4.7.4-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.phoebus</groupId> | ||
<artifactId>core-pv</artifactId> | ||
<version>4.7.4-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.aquenos.epics.jackie</groupId> | ||
<artifactId>epics-jackie-client</artifactId> | ||
<version>3.1.0</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
758 changes: 758 additions & 0 deletions
758
core/pv-jackie/src/main/java/org/phoebus/pv/jackie/JackiePV.java
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
core/pv-jackie/src/main/java/org/phoebus/pv/jackie/JackiePVFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 aquenos GmbH. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
******************************************************************************/ | ||
|
||
package org.phoebus.pv.jackie; | ||
|
||
import com.aquenos.epics.jackie.client.ChannelAccessClient; | ||
import com.aquenos.epics.jackie.client.ChannelAccessClientConfiguration; | ||
import com.aquenos.epics.jackie.client.DefaultChannelAccessClient; | ||
import com.aquenos.epics.jackie.client.beacon.BeaconDetectorConfiguration; | ||
import com.aquenos.epics.jackie.client.resolver.ChannelNameResolverConfiguration; | ||
import com.aquenos.epics.jackie.common.exception.JavaUtilLoggingErrorHandler; | ||
import com.aquenos.epics.jackie.common.util.ListenerLockPolicy; | ||
import org.phoebus.pv.PV; | ||
import org.phoebus.pv.PVFactory; | ||
|
||
import java.util.logging.Level; | ||
|
||
/** | ||
* <p> | ||
* Factory for instances of {@link JackiePV}. | ||
* </p> | ||
* <p> | ||
* Typically, this factory should not be used directly but through | ||
* {@link org.phoebus.pv.PVPool}. There is no need to create more than one | ||
* instance of this class, because all its state is static anyway. | ||
* </p> | ||
* <p> | ||
* This class statically creates an instance of EPICS Jackie’s | ||
* {@link DefaultChannelAccessClient}, which is configured using the default | ||
* instance of {@link JackiePreferences}. | ||
* </p> | ||
*/ | ||
public class JackiePVFactory implements PVFactory { | ||
|
||
private final static ChannelAccessClient CLIENT; | ||
private final static JackiePreferences PREFERENCES; | ||
private final static String TYPE = "jackie"; | ||
|
||
static { | ||
PREFERENCES = JackiePreferences.getDefaultInstance(); | ||
// We want to use a higher log-level for errors, so that we can be sure | ||
// that they are reported, even if INFO logging is not enabled. | ||
var error_handler = new JavaUtilLoggingErrorHandler( | ||
Level.SEVERE, Level.WARNING); | ||
var beacon_detector_config = new BeaconDetectorConfiguration( | ||
error_handler, | ||
PREFERENCES.ca_server_port(), | ||
PREFERENCES.ca_repeater_port()); | ||
var resolver_config = new ChannelNameResolverConfiguration( | ||
PREFERENCES.charset(), | ||
error_handler, | ||
PREFERENCES.hostname(), | ||
PREFERENCES.username(), | ||
PREFERENCES.ca_server_port(), | ||
PREFERENCES.ca_name_servers(), | ||
PREFERENCES.ca_address_list(), | ||
PREFERENCES.ca_auto_address_list(), | ||
PREFERENCES.ca_max_search_period(), | ||
PREFERENCES.ca_echo_interval(), | ||
PREFERENCES.ca_multicast_ttl()); | ||
var client_config = new ChannelAccessClientConfiguration( | ||
PREFERENCES.charset(), | ||
PREFERENCES.hostname(), | ||
PREFERENCES.username(), | ||
PREFERENCES.ca_max_array_bytes(), | ||
PREFERENCES.ca_max_array_bytes(), | ||
PREFERENCES.ca_echo_interval(), | ||
PREFERENCES.cid_block_reuse_time(), | ||
null, | ||
Boolean.TRUE, | ||
error_handler, | ||
beacon_detector_config, | ||
resolver_config); | ||
// We use ListenerLockPolicy.IGNORE, because we call listeners from our | ||
// code, and we cannot be sure whether these listeners might acquire | ||
// locks, so the BLOCK policy could result in deadlocks. | ||
CLIENT = new DefaultChannelAccessClient( | ||
client_config, ListenerLockPolicy.IGNORE); | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return TYPE; | ||
} | ||
|
||
@Override | ||
public PV createPV(String name, String base_name) throws Exception { | ||
return new JackiePV(CLIENT, PREFERENCES, name, base_name); | ||
} | ||
|
||
} |
Oops, something went wrong.