jmri.jmrix
Class ConnectionStatus

java.lang.Object
  extended by jmri.jmrix.ConnectionStatus

public class ConnectionStatus
extends Object

Interface for classes that wish to get notification when the connection to the layout changes.

Author:
Daniel Boudreau Copyright (C) 2007

Field Summary
static String CONNECTION_DOWN
           
static String CONNECTION_UNKNOWN
           
static String CONNECTION_UP
           
 
Constructor Summary
ConnectionStatus()
           
 
Method Summary
 void addConnection(String systemName, String portName)
           
 void addPropertyChangeListener(PropertyChangeListener l)
           
protected  void firePropertyChange(String p, Object old, Object n)
           
 String getConnectionState(String portName)
          get the status of a communication port
static ConnectionStatus instance()
           
 boolean isConnectionOk(String portName)
          Returns status of a communication port
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void setConnectionState(String portName, String state)
          sets the connection state of a communication port
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_UNKNOWN

public static final String CONNECTION_UNKNOWN
See Also:
Constant Field Values

CONNECTION_UP

public static final String CONNECTION_UP
See Also:
Constant Field Values

CONNECTION_DOWN

public static final String CONNECTION_DOWN
See Also:
Constant Field Values
Constructor Detail

ConnectionStatus

public ConnectionStatus()
Method Detail

instance

public static ConnectionStatus instance()

addConnection

public void addConnection(String systemName,
                          String portName)

setConnectionState

public void setConnectionState(String portName,
                               String state)
sets the connection state of a communication port

Parameters:
portName - = communication port name
state -

getConnectionState

public String getConnectionState(String portName)
get the status of a communication port

Parameters:
portName -
Returns:
status string

isConnectionOk

public boolean isConnectionOk(String portName)
Returns status of a communication port

Parameters:
portName -
Returns:
true if port connection is operational or unknown, false if not

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

firePropertyChange

protected void firePropertyChange(String p,
                                  Object old,
                                  Object n)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads