Skip to content

Commit 4411287

Browse files
committed
Register the channel access type support
1 parent b802d1b commit 4411287

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

gpclient/gpclient-ca/src/main/java/org/epics/gpclient/datasource/ca/CAChannelHandler.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
import java.util.logging.Level;
1111
import java.util.regex.Pattern;
1212

13+
import org.epics.gpclient.ReadCollector;
1314
import org.epics.gpclient.datasource.MultiplexedChannelHandler;
15+
import org.epics.gpclient.datasource.ca.types.CATypeAdapter;
1416

1517
import gov.aps.jca.CAException;
1618
import gov.aps.jca.Channel;
@@ -67,11 +69,9 @@ protected void connect() {
6769
// Give the listener right away so that no event gets lost
6870
// If it's a large array, connect using lower priority
6971
if (largeArray) {
70-
channel = caDataSource.getContext().createChannel(getChannelName(), connectionListener,
71-
Channel.PRIORITY_MIN);
72+
channel = caDataSource.getContext().createChannel(getChannelName(), connectionListener, Channel.PRIORITY_MIN);
7273
} else {
73-
channel = caDataSource.getContext().createChannel(getChannelName(), connectionListener,
74-
(short) (Channel.PRIORITY_MIN + 1));
74+
channel = caDataSource.getContext().createChannel(getChannelName(), connectionListener, (short) (Channel.PRIORITY_MIN + 1));
7575
}
7676
} catch (CAException ex) {
7777
throw new RuntimeException("JCA Connection failed", ex);
@@ -106,6 +106,11 @@ protected boolean isWriteConnected(CAConnectionPayload connPayload) {
106106
return connPayload != null && connPayload.isWriteConnected();
107107
}
108108

109+
@Override
110+
protected CATypeAdapter findTypeAdapter(ReadCollector<?, ?> cache, CAConnectionPayload connection) {
111+
return caDataSource.getCaTypeSupport().find(cache, connection);
112+
}
113+
109114
private final ConnectionListener connectionListener = new ConnectionListener() {
110115

111116
@Override

gpclient/gpclient-ca/src/main/java/org/epics/gpclient/datasource/ca/CADataSource.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class CADataSource extends DataSource {
3333
private boolean rtypValueOnly = false;
3434
private boolean honorZeroPrecision = true;
3535

36+
private final CATypeSupport caTypeSupport = new CATypeSupport(new CAVTypeAdapterSet());
37+
3638
public CADataSource() {
3739
super();
3840
// Some properties are not pre-initialized to the default,
@@ -75,6 +77,10 @@ public Context getContext() {
7577
return context;
7678
}
7779

80+
public CATypeSupport getCaTypeSupport() {
81+
return caTypeSupport;
82+
}
83+
7884
public int getMonitorMask() {
7985
return monitorMask;
8086
}

0 commit comments

Comments
 (0)