public class CAJServerContext extends ServerContext implements CAContext, Configurable
Context.| Modifier and Type | Field and Description |
|---|---|
protected CASAcceptor |
acceptor
CAS acceptor (accepts CA virtual circuit).
|
protected boolean |
autoBeaconAddressList
Define whether or not the network interfaces should be discovered at runtime.
|
protected String |
beaconAddressList
A space-separated list of broadcast address which to send beacons.
|
protected BeaconEmitter |
beaconEmitter
Beacon emitter..
|
protected float |
beaconPeriod
Period in second between two beacon signals.
|
protected int |
beaconPort
Port number for the repeater to listen to.
|
protected BroadcastTransport |
broadcastTransport
Broadcast transport needed for channel searches.
|
protected CachedByteBufferAllocator |
cachedBufferAllocator
Cached byte buffer allocator.
|
static String |
CAJ_SINGLE_THREADED_MODEL
String value of the JVM property key to turn on single threaded model.
|
protected ArrayList |
contextExceptionListeners
List of context exception listeners.
|
protected ArrayList |
contextMessageListeners
List of context message listeners.
|
protected String |
ignoreAddressList
A space-separated list of address from which to ignore name resolution requests.
|
protected LeaderFollowersThreadPool |
leaderFollowersThreadPool
Leader/followers thread pool.
|
protected Logger |
logger
Context logger.
|
protected int |
maxArrayBytes
Length in bytes of the maximum array size that may pass through CA.
|
protected Reactor |
reactor
Reactor.
|
protected Object |
runLock
Run lock.
|
protected Server |
server
Server.
|
protected int |
serverPort
Port number for the server to listen to.
|
protected Timer |
timer
Timer.
|
protected CATransportRegistry |
transportRegistry
CA transport (virtual circuit) registry.
|
static Version |
VERSION
Version.
|
| Constructor and Description |
|---|
CAJServerContext()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContextExceptionListener(ContextExceptionListener l)
Add a ContextExceptionListener to this context.
|
void |
addContextMessageListener(ContextMessageListener l)
Add a ContextMessageListener to this context.
|
protected void |
checkState()
Check context state and tries to establish necessary state.
|
void |
configure(Configuration configuration)
Pass the
Configuration to the Configurable
class. |
void |
destroy()
Clear all resources attached to this Context
|
int |
generateChannelSID()
Generate channel SID.
|
String |
getBeaconAddressList()
Get beacon address list.
|
float |
getBeaconPeriod()
Get beacon period (in seconds).
|
int |
getBeaconPort()
Get beacon port.
|
int |
getBroadcastPort()
Get broadcast port.
|
BroadcastTransport |
getBroadcastTransport()
Broadcast transport.
|
CachedByteBufferAllocator |
getCachedBufferAllocator()
Get cached byte allocator.
|
ContextExceptionListener[] |
getContextExceptionListeners() |
ContextMessageListener[] |
getContextMessageListeners() |
String |
getIgnoreAddressList()
Get ignore search address list.
|
int |
getLastReceivedSequenceNumber(int seqNo)
Set last UDP recived sequence number.
|
LeaderFollowersThreadPool |
getLeaderFollowersThreadPool()
Get LF thread pool.
|
Logger |
getLogger()
Get logger.
|
int |
getMaxArrayBytes()
Get max array payload size.
|
Reactor |
getReactor()
Get context reactor.
|
Server |
getServer()
Get server implementation.
|
InetAddress |
getServerInetAddress()
Get server newtwork (IP) address.
|
int |
getServerPort()
Get server port.
|
Timer |
getTimer()
Get timer.
|
CATransportRegistry |
getTransportRegistry()
Get CA transport (virtual circuit) registry.
|
String |
getUserName()
Get user name (used to report to the server).
|
Version |
getVersion()
Get context version.
|
void |
initialize(Server server)
Set server and initialize.
|
protected void |
initializeLogger()
Initialize context logger.
|
void |
invalidateLastReceivedSequence()
Invalidate last (UDP) received sequence.
|
boolean |
isAutoBeaconAddressList()
Get beacon address list auto flag.
|
boolean |
isDestroyed()
Get destruction status.
|
boolean |
isInitialized()
Get initialization status.
|
protected void |
loadConfiguration()
Load configuration.
|
void |
printInfo(PrintStream out)
Prints detailed information about the Context to the specified output stream.
|
void |
removeContextExceptionListener(ContextExceptionListener l)
Removes a ContextExceptionListener from this context.
|
void |
removeContextMessageListener(ContextMessageListener l)
Removes a ContextMessageListener from this context.
|
void |
run(int seconds)
Run server (process events).
|
void |
setLastReceivedSequenceNumber(int seqNo)
Set last UDP recived sequence number.
|
void |
setServerPort(int port)
Set server port number.
|
void |
shutdown()
Shutdown (stop executing run() method) of this Context.
|
dispose, printInfopublic static final Version VERSION
public static final String CAJ_SINGLE_THREADED_MODEL
protected Logger logger
protected String beaconAddressList
protected String ignoreAddressList
protected boolean autoBeaconAddressList
protected float beaconPeriod
protected int beaconPort
protected int serverPort
protected int maxArrayBytes
protected ArrayList contextMessageListeners
protected ArrayList contextExceptionListeners
protected Timer timer
protected Reactor reactor
protected LeaderFollowersThreadPool leaderFollowersThreadPool
protected BroadcastTransport broadcastTransport
protected BeaconEmitter beaconEmitter
protected CASAcceptor acceptor
protected CATransportRegistry transportRegistry
protected CachedByteBufferAllocator cachedBufferAllocator
protected Server server
protected Object runLock
public Version getVersion()
getVersion in class ServerContextContext.getVersion()protected void initializeLogger()
protected void loadConfiguration()
public void configure(Configuration configuration) throws ConfigurationException
ConfigurableConfiguration to the Configurable
class. This method must always be called after the constructor
and before any other method.configure in interface Configurableconfiguration - the class configurations.ConfigurationException - if an error occursConfigurable.configure(gov.aps.jca.configuration.Configuration)public ContextMessageListener[] getContextMessageListeners() throws IllegalStateException
getContextMessageListeners in class ServerContextIllegalStateException - illegal or inappropriate invocation of errorContext.getContextMessageListeners()public void addContextMessageListener(ContextMessageListener l) throws CAException, IllegalStateException
ServerContextaddContextMessageListener in class ServerContextl - The listener interface for receiving ContextMessageEventsCAException - JCA ExceptionIllegalStateException - null listenerContext.addContextMessageListener(gov.aps.jca.event.ContextMessageListener)public void removeContextMessageListener(ContextMessageListener l) throws CAException, IllegalStateException
ServerContextremoveContextMessageListener in class ServerContextl - the listener to removeCAException - CA ExceptionIllegalStateException - if the context has been destroyed.Context.removeContextMessageListener(gov.aps.jca.event.ContextMessageListener)public ContextExceptionListener[] getContextExceptionListeners() throws IllegalStateException
getContextExceptionListeners in class ServerContextIllegalStateException - if the context has been destroyed.Context.getContextExceptionListeners()public void addContextExceptionListener(ContextExceptionListener l) throws CAException, IllegalStateException
ServerContextaddContextExceptionListener in class ServerContextl - the listener to addCAException - CA ExceptionIllegalStateException - if the context has been destroyed.Context.addContextExceptionListener(gov.aps.jca.event.ContextExceptionListener)public void removeContextExceptionListener(ContextExceptionListener l) throws CAException, IllegalStateException
ServerContextremoveContextExceptionListener in class ServerContextl - the listener to removeCAException - CA ExceptionIllegalStateException - if the context has been destroyed.Context.removeContextExceptionListener(gov.aps.jca.event.ContextExceptionListener)protected void checkState()
throws CAException,
IllegalStateException
CAException - JCA ExceptionIllegalStateException - illegal or inappropriate invocation of errorpublic void initialize(Server server) throws CAException, IllegalStateException
initialize in class ServerContextserver - Server implementation providing ProcessVariable access (existance test and attach).CAException - IllegalStateExceptionIllegalStateExceptionServerContext.initialize(gov.aps.jca.cas.Server)public void run(int seconds)
throws CAException,
IllegalStateException
run in class ServerContextseconds - time in seconds the server will process events (method will block), if 0
the method would block until destory() is called.IllegalStateException - if server is already destroyed.CAException - JCA Exceptionpublic void shutdown()
throws CAException,
IllegalStateException
ServerContextshutdown in class ServerContextCAException - CA ExceptionIllegalStateException - if the context has been destroyed.ServerContext.shutdown()public void destroy()
throws CAException,
IllegalStateException
ServerContextdestroy in class ServerContextCAException - CA ExceptionIllegalStateException - if the context has been destroyed.Context.destroy()public void printInfo(PrintStream out) throws IllegalStateException
ServerContextprintInfo in class ServerContextout - the output stream.IllegalStateException - if the context has been destroyed.Context.printInfo(java.io.PrintStream)public boolean isInitialized()
public boolean isDestroyed()
public String getBeaconAddressList()
public boolean isAutoBeaconAddressList()
public float getBeaconPeriod()
public Logger getLogger()
getLogger in interface LoggerProviderpublic int getMaxArrayBytes()
public int getBeaconPort()
public int getServerPort()
getServerPort in interface CAContextpublic void setServerPort(int port)
port - new server port number.public int getBroadcastPort()
getBroadcastPort in interface CAContextpublic String getIgnoreAddressList()
public InetAddress getServerInetAddress()
null if not bounded.public Reactor getReactor()
getReactor in interface CAContextpublic BroadcastTransport getBroadcastTransport()
getBroadcastTransport in interface CAContextpublic CATransportRegistry getTransportRegistry()
getTransportRegistry in interface CAContextpublic Timer getTimer()
public CachedByteBufferAllocator getCachedBufferAllocator()
getCachedBufferAllocator in interface CAContextpublic LeaderFollowersThreadPool getLeaderFollowersThreadPool()
getLeaderFollowersThreadPool in interface CAContextnull if disabled.public Server getServer()
public int generateChannelSID()
public final void setLastReceivedSequenceNumber(int seqNo)
seqNo - last UDP recived sequence number.public final int getLastReceivedSequenceNumber(int seqNo)
seqNo - last UDP recived sequence number.public final void invalidateLastReceivedSequence()
CAContextinvalidateLastReceivedSequence in interface CAContextCAContext.invalidateLastReceivedSequence()public String getUserName()
CAContextgetUserName in interface CAContextCAContext.getUserName()Copyright © 2004-2020 EPICS. All Rights Reserved.