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
Modifier and TypeClassDescriptionstatic class
Makes one time asynchronous requests.Nested classes/interfaces inherited from class org.scictrl.csshell.AbstractConnector
AbstractConnector.DefaultConnectionCache
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default authority.static final int
Default verbosity level.static final String
Parameter name for expert monitor creation.static final String
Property name for default monitor property.static final String
Property name for default pendIO timeout property.static final String
ConstantPROPERTY_JCA_ADDR_LIST="addr_list"
static final String
ConstantPROPERTY_JCA_AUTO_ADDR_LIST="auto_addr_list"
static final String
ConstantPROPERTY_JCA_BEACON_PERIOD="beacon_period"
static final String
ConstantPROPERTY_JCA_CONNECTION_TIMEOUT="connection_timeout"
static final String
ConstantPROPERTY_JCA_MAX_ARRAY_BYTES="max_array_bytes"
static final String
ConstantPROPERTY_JCA_NAME_SERVERS="name_servers"
static final String
ConstantPROPERTY_JCA_REPEATER_PORT="repeater_port"
static final String
ConstantPROPERTY_JCA_SERVER_PORT="server_port"
static final String
Property name for JNI flush timer delay.static final String
Property name for JCA context type flag.static final String
Property name for verbosity of INFO log level.static final String
Plug 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 TypeMethodDescriptionvoid
contextException
(gov.aps.jca.event.ContextExceptionEvent ev) void
contextMessage
(gov.aps.jca.event.ContextMessageEvent ev) void
contextVirtualCircuitException
(gov.aps.jca.event.ContextVirtualCircuitExceptionEvent ev) void
flushIO()
flushIO.gov.aps.jca.Context
Getter for the fieldcontext
.int
Gets the default monitor mask.static AbstractConnector
<?> getInstance
(Properties configuration) Create new EPICS plug instance.getMetaData
(String name, DataType type) getMetaData.void
getMetaDataAsync
(gov.aps.jca.Channel channel, PropertyChangeListener l) getMetaDataAsync.void
getMetaDataAsync
(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.DBR
getOneShot
(String name, gov.aps.jca.dbr.DBRType type) getOneShot.long
Get timeout parameter (in milliseconds).getType()
getType.getValue.int
Getter for the fieldverbosity
.boolean
isDbrUpdatesCharacteristics.boolean
Gets theinitializeCharacteristicsOnConnect
property.boolean
GetsuseCommonExecutor
property.newConnection
(String name, DataType dataType) newConnection.static EPICSConnector
newInstance
(Properties configuration) Create new EPICS plug instance.void
pendIO()
pendIO.void
shutdown()
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. Iffalse
or not defined then by default CAJ instance of JCA context is used. If value set totrue
in 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
- aProperties
object- Returns:
- a
EPICSConnector
object - Throws:
RemoteException
- if initialization of remote context fails
-
getInstance
Create new EPICS plug instance.- Parameters:
configuration
- aProperties
object- Returns:
- a
EPICSConnector
object - Throws:
RemoteException
- if initialization of remote context fails
-
shutdown
shutdown.
- Overrides:
shutdown
in classAbstractConnector<EPICSConnection<?>>
- Throws:
Exception
- if any.
-
getVerbosity
public int getVerbosity()Getter for the field
verbosity
.- Returns:
- a int
-
getType
getType.
- Specified by:
getType
in classAbstractConnector<EPICSConnection<?>>
- Returns:
- a
String
object
-
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
Context
object
-
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 theinitializeCharacteristicsOnConnect
property.- Returns:
true
if characteristics should be initialized on connect andfalse
otherwise.
-
isDbrUpdatesCharacteristics
public boolean isDbrUpdatesCharacteristics()isDbrUpdatesCharacteristics.
- Returns:
- a boolean
-
isUseCommonExecutor
public boolean isUseCommonExecutor()GetsuseCommonExecutor
property.- Returns:
true
if common executor should be used andfalse
otherwise.
-
contextException
public void contextException(gov.aps.jca.event.ContextExceptionEvent ev) - Specified by:
contextException
in interfacegov.aps.jca.event.ContextExceptionListener
-
contextVirtualCircuitException
public void contextVirtualCircuitException(gov.aps.jca.event.ContextVirtualCircuitExceptionEvent ev) - Specified by:
contextVirtualCircuitException
in interfacegov.aps.jca.event.ContextExceptionListener
-
contextMessage
public void contextMessage(gov.aps.jca.event.ContextMessageEvent ev) - Specified by:
contextMessage
in interfacegov.aps.jca.event.ContextMessageListener
-
getMetaData
getMetaData.
- Specified by:
getMetaData
in classAbstractConnector<EPICSConnection<?>>
- Parameters:
name
- aString
objecttype
- aDataType
object- Returns:
- a
MetaData
object - Throws:
Exception
- if any.
-
getMetaDataAsync
getMetaDataAsync.
- Parameters:
name
- aString
objecttype
- aDataType
objectl
- aPropertyChangeListener
object- Throws:
Exception
- if any.
-
getMetaDataAsync
public void getMetaDataAsync(gov.aps.jca.Channel channel, PropertyChangeListener l) throws Exception getMetaDataAsync.
- Specified by:
getMetaDataAsync
in classAbstractConnector<EPICSConnection<?>>
- Parameters:
channel
- aChannel
objectl
- aPropertyChangeListener
object- 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:
getValue
in classAbstractConnector<EPICSConnection<?>>
- Parameters:
name
- aString
objecttype
- aDataType
object- Returns:
- a
Object
object - Throws:
RemoteException
- if any.
-
newConnection
newConnection.
- Specified by:
newConnection
in classAbstractConnector<EPICSConnection<?>>
- Parameters:
name
- aString
objectdataType
- aDataType
object- Returns:
- a C object
- Throws:
RemoteException
- if any.
-