stella.io
Class DummyRS485

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by io.AbstractDriver
                  extended by io.AbstractSerialDriver
                      extended by stella.io.RS485Server
                          extended by stella.io.CastingRS485Server
                              extended by stella.io.WatchdogRS485Server
                                  extended by stella.io.PollingRS485Server
                                      extended by stella.io.DummyRS485
All Implemented Interfaces:
Driver, Cloneable, Remote, CacheChangedCaster, PollerQuery, RmiSerialCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster

public class DummyRS485
extends PollingRS485Server

A dummy class for testing event casting by the serial server. Needs protected blockReadString(java.lang.String, int) and writeString(java.lang.String) methods in the RS485Server main class.


Nested Class Summary
 
Nested classes/interfaces inherited from class stella.io.PollingRS485Server
PollingRS485Server.CacheDump, PollingRS485Server.ConcurrentTest, PollingRS485Server.Interleave, PollingRS485Server.Poller, PollingRS485Server.Test
 
Nested classes/interfaces inherited from class stella.io.RS485Server
RS485Server.Checksum, RS485Server.Command, RS485Server.Info, RS485Server.Scan
 
Nested classes/interfaces inherited from class io.AbstractSerialDriver
AbstractSerialDriver.Available
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
 
Fields inherited from class stella.io.PollingRS485Server
cache, cachelisten, KEY_ACTIVEDROP, KEY_ACTIVEREAD, KEY_CASTPOLL, KEY_PASSIVEDROP, KEY_PASSIVEREAD, KEY_POLLBASE, KEY_RESPONDMAX, KEY_STARTOPEN, timecurrent, timemax, timemin, validcache
 
Fields inherited from class stella.io.WatchdogRS485Server
hosttimer, KEY_CASTOK, KEY_COOLDOWN, KEY_HOSTOK, KEY_INCREMENT, KEY_OKTIME, KEY_RESETONCLOSE, KEY_SAFETY, KEY_WATCHDOG, KEY_WATCHTIME
 
Fields inherited from class stella.io.CastingRS485Server
KEY_BIND
 
Fields inherited from class stella.io.RS485Server
KEY_CHECKCHAR, KEY_CHECKSUM, KEY_CLOSE, KEY_CR, KEY_ECHO, KEY_FAILTIME, KEY_FAILURES, KEY_INVALID, KEY_MAXBUFFER, KEY_MAXBUSY, KEY_QUERYTIME, KEY_REINIT, KEY_RESPONDTIME, KEY_STARTUP, KEY_TIMEBUSY, lock
 
Fields inherited from class io.AbstractSerialDriver
inport, KEY_BAUDRATE, KEY_CLOSETIMEOUT, KEY_DATABIT, KEY_FLOWCONTROL, KEY_INBUFFER, KEY_NOTIFYCOOLDOWN, KEY_OUTBUFFER, KEY_PARITYBIT, KEY_PORTNAME, KEY_RECEIVEFRAMING, KEY_RECEIVETHRESHOLD, KEY_RECEIVETIMEOUT, KEY_STOPBIT, KEY_TIMEOUT, outport, staticlock
 
Fields inherited from class io.AbstractDriver
KEY_DRIVERNAME
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.rmi.RmiSerialCaster
NAMING_EXTENSION
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
DummyRS485(Map prop)
           
 
Method Summary
protected  String blockReadString(String cmd, int count)
          For testing.
 boolean close()
          Returns, there was nothing opened.
 boolean open()
          Always return true.
 String writeString(String blahblah)
          Writes the argumental string to the output stream.
 
Methods inherited from class stella.io.PollingRS485Server
addCacheChangedListener, blockChannel, exit, getPollerCache, init, initCache, interleaveCommand, isActive, isPolling, readChannel, removeCacheChangedListener, setActive, setPassive, startPolling, stopPolling, toString, validChannel
 
Methods inherited from class stella.io.WatchdogRS485Server
resetWatchdog, startWatchdog
 
Methods inherited from class stella.io.CastingRS485Server
addRmiSerialListener, bindToRegistry, isValid, notifyListeners, removeRmiSerialListener, unbindFromRegistry, writeCommand, writeCommand, writeString
 
Methods inherited from class stella.io.RS485Server
deferCommand, ensureCommand, getCheckSum, getCheckSumming, isReading, readString, setCheckSumming
 
Methods inherited from class io.AbstractSerialDriver
createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, isOpen, registerSoleEventListener, resetOriginalParameters
 
Methods inherited from class io.AbstractDriver
createDriver, equals, hashCode
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Constructor Detail

DummyRS485

public DummyRS485(Map prop)
Method Detail

open

public boolean open()
Always return true.

Specified by:
open in interface Driver
Overrides:
open in class PollingRS485Server
Returns:
True if initialization was successful.

writeString

public String writeString(String blahblah)
Description copied from class: RS485Server
Writes the argumental string to the output stream. The serial port must be opened prior to calling this method, otherwise writing will fail. If checksumming is enabled the checksum is calculated from the command string and added to the transferred byte array imediately before the terminal RS485Server.KEY_CR character(s).

Note that this method calls flush on the output stream after writing the String as a series of bytes to the port.

This method does not synchronize on the serial port! External synchronization by locking on the RS485Server.lock object is necessary, if this method is used outside of the RS485Server.writeCommand(java.lang.String) method.

Overrides:
writeString in class RS485Server
Returns:
The entire string writtn to the port, including chksum and CR

blockReadString

protected String blockReadString(String cmd,
                                 int count)
For testing. Uncomment for true functionality.


close

public boolean close()
Returns, there was nothing opened.

Specified by:
close in interface Driver
Overrides:
close in class PollingRS485Server
Returns:
True if clean-up was successful.