flatscape
Class FConnection

java.lang.Object
  |
  +--flatscape.FConnection
All Implemented Interfaces:
Configurable, ConnectionListener

public class FConnection
extends java.lang.Object
implements Configurable, ConnectionListener

Configurable class, which handles the connection to the server.

Example of configuration:

  <COMPONENT class="flatscape.FConnection">
  	<FACTORY class="disciple.connections.TcpConnectionFactory"
  		     host="127.0.0.1"
  		     port="4000"
  	/>
  </COMPONENT>
  

Copyright © 2002 Rutgers, The State University of New Jersey

Version:
$Revision: 1.4 $

Field Summary
protected  Connection connection_
           
protected  ConnectionFactory connectionFactory_
           
protected  int state_
           
protected  AbstractViewer viewer_
           
 
Constructor Summary
FConnection()
           
 
Method Summary
 java.lang.Object config(java.lang.Object parent, org.w3c.dom.Element config)
          Called upon loading of the XML configuation files.
 void connectionAdded(Connection connection, org.w3c.dom.Element status)
           
 void connectionChanged(Connection connection, org.w3c.dom.Element status)
           
 void connectionRemoved(Connection connection)
           
 int getState()
           
 void login()
          Logon to the server.
 void logoff()
          Logoff from the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state_

protected int state_

viewer_

protected AbstractViewer viewer_

connection_

protected Connection connection_

connectionFactory_

protected ConnectionFactory connectionFactory_
Constructor Detail

FConnection

public FConnection()
Method Detail

login

public void login()
Logon to the server.


logoff

public void logoff()
Logoff from the server.


getState

public int getState()
Returns:
the state of the connection (see disciple.core.Connection)

config

public java.lang.Object config(java.lang.Object parent,
                               org.w3c.dom.Element config)
                        throws java.lang.Exception
Called upon loading of the XML configuation files. Before this method is called, the no argument constructor is called.

Specified by:
config in interface Configurable
Parameters:
parent - The argument passed into the Config.getList method
config - The DOM element representing the XML element that loaded this class.
Returns:
The configured class, usually returns this.
Throws:
java.lang.Exception - Thrown if there is any problem configuring this class.

connectionChanged

public void connectionChanged(Connection connection,
                              org.w3c.dom.Element status)
Specified by:
connectionChanged in interface ConnectionListener
Parameters:
status -

connectionAdded

public void connectionAdded(Connection connection,
                            org.w3c.dom.Element status)
Specified by:
connectionAdded in interface ConnectionListener
Parameters:
status -
connection -

connectionRemoved

public void connectionRemoved(Connection connection)
Specified by:
connectionRemoved in interface ConnectionListener
Parameters:
connection -


Copyright (c) 2003 Rutgers, The State University of New Jersey