Package org.scictrl.csshell.epics
Class EPICSConnector
- All Implemented Interfaces:
gov.aps.jca.event.ContextExceptionListener,gov.aps.jca.event.ContextMessageListener,EventListener
public class EPICSConnector
extends AbstractConnector<EPICSConnection<?>>
implements gov.aps.jca.event.ContextExceptionListener, gov.aps.jca.event.ContextMessageListener
Implementation of EPICS plugin.
- Author:
- igor@scictrl.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMakes one time asynchronous requests.Nested classes/interfaces inherited from class org.scictrl.csshell.AbstractConnector
AbstractConnector.DefaultConnectionCache -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault authority.static final intDefault verbosity level.static final StringParameter name for expert monitor creation.static final StringProperty name for default monitor property.static final StringProperty name for default pendIO timeout property.static final StringConstantPROPERTY_JCA_ADDR_LIST="addr_list"static final StringConstantPROPERTY_JCA_AUTO_ADDR_LIST="auto_addr_list"static final StringConstantPROPERTY_JCA_BEACON_PERIOD="beacon_period"static final StringConstantPROPERTY_JCA_CONNECTION_TIMEOUT="connection_timeout"static final StringConstantPROPERTY_JCA_MAX_ARRAY_BYTES="max_array_bytes"static final StringConstantPROPERTY_JCA_NAME_SERVERS="name_servers"static final StringConstantPROPERTY_JCA_REPEATER_PORT="repeater_port"static final StringConstantPROPERTY_JCA_SERVER_PORT="server_port"static final StringProperty name for JNI flush timer delay.static final StringProperty name for JCA context type flag.static final StringProperty name for verbosity of INFO log level.static final StringPlug type string.Fields inherited from class org.scictrl.csshell.AbstractConnector
connectionCache, debug, PROPERTY_CORE_THREADS, PROPERTY_MAX_THREADS, PROPERTY_READ_ONLY -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextException(gov.aps.jca.event.ContextExceptionEvent ev) voidcontextMessage(gov.aps.jca.event.ContextMessageEvent ev) voidcontextVirtualCircuitException(gov.aps.jca.event.ContextVirtualCircuitExceptionEvent ev) voidflushIO()flushIO.gov.aps.jca.ContextGetter for the fieldcontext.intGets the default monitor mask.static AbstractConnector<?> getInstance(Properties configuration) Create new EPICS plug instance.getMetaData(String name, DataType type) getMetaData.voidgetMetaDataAsync(gov.aps.jca.Channel channel, PropertyChangeListener l) getMetaDataAsync.voidgetMetaDataAsync(String name, DataType type, PropertyChangeListener l) getMetaDataAsync.Poop<?, gov.aps.jca.dbr.DBR> getOneShot(String name) Makes one time get request and tries to get as many data as possible.gov.aps.jca.dbr.DBRgetOneShot(String name, gov.aps.jca.dbr.DBRType type) getOneShot.longGet timeout parameter (in milliseconds).getType()getType.getValue.intGetter for the fieldverbosity.booleanisDbrUpdatesCharacteristics.booleanGets theinitializeCharacteristicsOnConnectproperty.booleanGetsuseCommonExecutorproperty.newConnection(String name, DataType dataType) newConnection.static EPICSConnectornewInstance(Properties configuration) Create new EPICS plug instance.voidpendIO()pendIO.voidshutdown()shutdown.Methods inherited from class org.scictrl.csshell.AbstractConnector
getConfiguration, getConnectionCache, getCoreThreads, getDefaultMetaData, getExecutor, getLogger, getMaxThreads, isAlive, isDebug, isReadOnly, newDefaultConnectionCache, registerDefaultMetaData, schedule, setConnectionCache
-
Field Details
-
TYPE
Plug type string.- See Also:
-
DEFAULT_AUTHORITY
Default authority.- See Also:
-
PROPERTY_USE_JNI
Property name for JCA context type flag. Iffalseor not defined then by default CAJ instance of JCA context is used. If value set totruein System properties or in configuration properties, then JNI (thread safe) instance of JCA context is used. Property defined in System properties take precedence before property in defined in configuration.- See Also:
-
PARAMETER_MONITOR_MASK
Parameter name for expert monitor creation. Value is of type Integer and provides mask value for EPICS monitor creation.- See Also:
-
PROPERTY_VERBOSITY
Property name for verbosity of INFO log level. Verbosity 0 is minimal, verbosity 1 reports individual connections are made. Default is 1.- See Also:
-
PROPERTY_DEFAULT_PENDIO_TIMEOUT
Property name for default pendIO timeout property. Value is of type Double and provides the default timeout for pendIO.- See Also:
-
PROPERTY_DEFAULT_MONITOR_MASK
Property name for default monitor property. Value is of type Integer and provides mask value for default EPICS monitor creation.- See Also:
-
PROPERTY_JNI_FLUSH_TIMER_DELAY
Property name for JNI flush timer delay. The default value is 100 ms and it is overridden if provided in the configuration. Property defined in System properties take precedence before property in defined in configuration.- See Also:
-
DEFAULT_VERBOSITY
public static final int DEFAULT_VERBOSITYDefault verbosity level.- See Also:
-
PROPERTY_JCA_ADDR_LIST
ConstantPROPERTY_JCA_ADDR_LIST="addr_list"- See Also:
-
PROPERTY_JCA_AUTO_ADDR_LIST
ConstantPROPERTY_JCA_AUTO_ADDR_LIST="auto_addr_list"- See Also:
-
PROPERTY_JCA_NAME_SERVERS
ConstantPROPERTY_JCA_NAME_SERVERS="name_servers"- See Also:
-
PROPERTY_JCA_CONNECTION_TIMEOUT
ConstantPROPERTY_JCA_CONNECTION_TIMEOUT="connection_timeout"- See Also:
-
PROPERTY_JCA_BEACON_PERIOD
ConstantPROPERTY_JCA_BEACON_PERIOD="beacon_period"- See Also:
-
PROPERTY_JCA_REPEATER_PORT
ConstantPROPERTY_JCA_REPEATER_PORT="repeater_port"- See Also:
-
PROPERTY_JCA_SERVER_PORT
ConstantPROPERTY_JCA_SERVER_PORT="server_port"- See Also:
-
PROPERTY_JCA_MAX_ARRAY_BYTES
ConstantPROPERTY_JCA_MAX_ARRAY_BYTES="max_array_bytes"- See Also:
-
-
Method Details
-
newInstance
Create new EPICS plug instance.- Parameters:
configuration- aPropertiesobject- Returns:
- a
EPICSConnectorobject - Throws:
RemoteException- if initialization of remote context fails
-
getInstance
Create new EPICS plug instance.- Parameters:
configuration- aPropertiesobject- Returns:
- a
EPICSConnectorobject - Throws:
RemoteException- if initialization of remote context fails
-
shutdown
shutdown.
- Overrides:
shutdownin classAbstractConnector<EPICSConnection<?>>- Throws:
Exception- if any.
-
getVerbosity
public int getVerbosity()Getter for the field
verbosity.- Returns:
- a int
-
getType
getType.
- Specified by:
getTypein classAbstractConnector<EPICSConnection<?>>- Returns:
- a
Stringobject
-
flushIO
public void flushIO()flushIO.
-
pendIO
pendIO.
- Throws:
gov.aps.jca.CAException- if any.gov.aps.jca.TimeoutException- if any.RemoteException- if any.
-
getContext
public gov.aps.jca.Context getContext()Getter for the field
context.- Returns:
- a
Contextobject
-
getTimeout
public long getTimeout()Get timeout parameter (in milliseconds). It is configured trough system property defined by org.epics.css.dal.spi.Plugs.CONNECTION_TIMEOUT.- Returns:
- timeout (in milliseconds)
-
getDefaultMonitorMask
public int getDefaultMonitorMask()Gets the default monitor mask.- Returns:
- the default monitor mask
-
isInitializeCharacteristicsOnConnect
public boolean isInitializeCharacteristicsOnConnect()Gets theinitializeCharacteristicsOnConnectproperty.- Returns:
trueif characteristics should be initialized on connect andfalseotherwise.
-
isDbrUpdatesCharacteristics
public boolean isDbrUpdatesCharacteristics()isDbrUpdatesCharacteristics.
- Returns:
- a boolean
-
isUseCommonExecutor
public boolean isUseCommonExecutor()GetsuseCommonExecutorproperty.- Returns:
trueif common executor should be used andfalseotherwise.
-
contextException
public void contextException(gov.aps.jca.event.ContextExceptionEvent ev) - Specified by:
contextExceptionin interfacegov.aps.jca.event.ContextExceptionListener
-
contextVirtualCircuitException
public void contextVirtualCircuitException(gov.aps.jca.event.ContextVirtualCircuitExceptionEvent ev) - Specified by:
contextVirtualCircuitExceptionin interfacegov.aps.jca.event.ContextExceptionListener
-
contextMessage
public void contextMessage(gov.aps.jca.event.ContextMessageEvent ev) - Specified by:
contextMessagein interfacegov.aps.jca.event.ContextMessageListener
-
getMetaData
getMetaData.
- Specified by:
getMetaDatain classAbstractConnector<EPICSConnection<?>>- Parameters:
name- aStringobjecttype- aDataTypeobject- Returns:
- a
MetaDataobject - Throws:
Exception- if any.
-
getMetaDataAsync
getMetaDataAsync.
- Parameters:
name- aStringobjecttype- aDataTypeobjectl- aPropertyChangeListenerobject- Throws:
Exception- if any.
-
getMetaDataAsync
public void getMetaDataAsync(gov.aps.jca.Channel channel, PropertyChangeListener l) throws Exception getMetaDataAsync.
- Specified by:
getMetaDataAsyncin classAbstractConnector<EPICSConnection<?>>- Parameters:
channel- aChannelobjectl- aPropertyChangeListenerobject- Throws:
Exception- if any.
-
getOneShot
getOneShot.
-
getOneShot
Makes one time get request and tries to get as many data as possible. Data type is taken from channel.- Parameters:
name- PV name- Returns:
- the Poop object with everything
- Throws:
Exception- if any
-
getValue
getValue.
- Specified by:
getValuein classAbstractConnector<EPICSConnection<?>>- Parameters:
name- aStringobjecttype- aDataTypeobject- Returns:
- a
Objectobject - Throws:
RemoteException- if any.
-
newConnection
newConnection.
- Specified by:
newConnectionin classAbstractConnector<EPICSConnection<?>>- Parameters:
name- aStringobjectdataType- aDataTypeobject- Returns:
- a C object
- Throws:
RemoteException- if any.
-