Class BeaconEmitter
- java.lang.Object
-
- org.epics.pvaccess.server.impl.remote.BeaconEmitter
-
- All Implemented Interfaces:
Lockable
,TransportSender
,org.epics.pvdata.misc.Timer.TimerCallback
public class BeaconEmitter extends Object implements org.epics.pvdata.misc.Timer.TimerCallback, TransportSender
Beacon emitter.- Version:
- $Id$
- Author:
- Matej Sekoranja
-
-
Field Summary
Fields Modifier and Type Field Description protected short
beaconCountLimit
Limit on number of beacons issued.protected byte
beaconSequenceID
Beacon sequence ID.protected static float
EPICS_PVA_MIN_BEACON_COUNT_LIMIT
Minimal PVA beacon count limit.protected static float
EPICS_PVA_MIN_BEACON_PERIOD
Minimal (initial) PVA beacon period (in seconds).protected double
fastBeaconPeriod
Fast (at startup) beacon period (in sec).protected byte[]
guid
Server GUID.protected Logger
logger
Logger.protected String
protocol
Protocol.protected InetAddress
serverAddress
Server address.protected int
serverPort
Server port.protected double
slowBeaconPeriod
Slow (after beaconCountLimit is reached) beacon period (in sec).protected org.epics.pvdata.misc.Timer
timer
Timer.protected Transport
transport
Transport.
-
Constructor Summary
Constructors Constructor Description BeaconEmitter(String protocol, Transport transport, ServerContextImpl context)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
callback()
void
destroy()
Destroy emitter.void
lock()
protected void
reschedule()
Reschedule timer.void
send(ByteBuffer buffer, TransportSendControl control)
Called by transport.protected void
start()
Start emitting.void
timerStopped()
void
unlock()
-
-
-
Field Detail
-
EPICS_PVA_MIN_BEACON_PERIOD
protected static final float EPICS_PVA_MIN_BEACON_PERIOD
Minimal (initial) PVA beacon period (in seconds).- See Also:
- Constant Field Values
-
EPICS_PVA_MIN_BEACON_COUNT_LIMIT
protected static final float EPICS_PVA_MIN_BEACON_COUNT_LIMIT
Minimal PVA beacon count limit.- See Also:
- Constant Field Values
-
timer
protected final org.epics.pvdata.misc.Timer timer
Timer.
-
logger
protected final Logger logger
Logger.
-
protocol
protected final String protocol
Protocol.
-
transport
protected final Transport transport
Transport.
-
beaconSequenceID
protected byte beaconSequenceID
Beacon sequence ID.
-
fastBeaconPeriod
protected final double fastBeaconPeriod
Fast (at startup) beacon period (in sec).
-
slowBeaconPeriod
protected final double slowBeaconPeriod
Slow (after beaconCountLimit is reached) beacon period (in sec).
-
beaconCountLimit
protected final short beaconCountLimit
Limit on number of beacons issued.
-
guid
protected final byte[] guid
Server GUID.
-
serverAddress
protected final InetAddress serverAddress
Server address.
-
serverPort
protected final int serverPort
Server port.
-
-
Constructor Detail
-
BeaconEmitter
public BeaconEmitter(String protocol, Transport transport, ServerContextImpl context)
Constructor.- Parameters:
protocol
- what protocol to "beacon".transport
- transport to be used to send beacons.context
- PVA context.
-
-
Method Detail
-
start
protected void start()
Start emitting.
-
reschedule
protected void reschedule()
Reschedule timer.
-
callback
public void callback()
- Specified by:
callback
in interfaceorg.epics.pvdata.misc.Timer.TimerCallback
-
send
public void send(ByteBuffer buffer, TransportSendControl control)
Description copied from interface:TransportSender
Called by transport. By this call transport gives callee ownership over the buffer. Calls onTransportSendControl
instance must be made from calling thread. Moreover, ownership is valid only for the time of call of this method. NOTE: these limitations allow efficient implementation.- Specified by:
send
in interfaceTransportSender
- Parameters:
buffer
- buffer to send.control
- transport send control instance.
-
timerStopped
public void timerStopped()
- Specified by:
timerStopped
in interfaceorg.epics.pvdata.misc.Timer.TimerCallback
-
destroy
public void destroy()
Destroy emitter.
-
-