com.vaadin.ui
Class ConnectorTracker

java.lang.Object
  extended by com.vaadin.ui.ConnectorTracker
All Implemented Interfaces:
Serializable

public class ConnectorTracker
extends Object
implements Serializable

A class which takes care of book keeping of ClientConnectors for a Root.

Provides getConnector(String) which can be used to lookup a connector from its id. This is for framework use only and should not be needed in applications.

Tracks which ClientConnectors are dirty so they can be updated to the client when the following response is sent. A connector is dirty when an operation has been performed on it on the server and as a result of this operation new information needs to be sent to its ServerConnector.

Since:
7.0.0
Version:
7.0.0.alpha3
Author:
Vaadin Ltd
See Also:
Serialized Form

Constructor Summary
ConnectorTracker(Root root)
          Creates a new ConnectorTracker for the given root.
 
Method Summary
 void cleanConnectorMap()
          Cleans the connector map from all connectors that are no longer attached to the application.
 ClientConnector getConnector(String connectorId)
          Gets a connector by its id.
 Collection<ClientConnector> getDirtyConnectors()
          Returns a collection of all connectors which have been marked as dirty.
static Logger getLogger()
          Gets a logger for this class
 void markAllConnectorsClean()
          Mark all connectors in this root as clean.
 void markAllConnectorsDirty()
          Mark all connectors in this root as dirty.
 void markClean(ClientConnector connector)
          Mark the connector as clean.
 void markDirty(ClientConnector connector)
          Mark the connector as dirty.
 void registerConnector(ClientConnector connector)
          Register the given connector.
 void unregisterConnector(ClientConnector connector)
          Unregister the given connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorTracker

public ConnectorTracker(Root root)
Creates a new ConnectorTracker for the given root. A tracker is always attached to a root and the root cannot be changed during the lifetime of a ConnectorTracker.

Parameters:
root - The root to attach to. Cannot be null.
Method Detail

getLogger

public static Logger getLogger()
Gets a logger for this class

Returns:
A logger instance for logging within this class

registerConnector

public void registerConnector(ClientConnector connector)
Register the given connector.

The lookup method getConnector(String) only returns registered connectors.

Parameters:
connector - The connector to register.

unregisterConnector

public void unregisterConnector(ClientConnector connector)
Unregister the given connector.

The lookup method getConnector(String) only returns registered connectors.

Parameters:
connector - The connector to unregister

getConnector

public ClientConnector getConnector(String connectorId)
Gets a connector by its id.

Parameters:
connectorId - The connector id to look for
Returns:
The connector with the given id or null if no connector has the given id

cleanConnectorMap

public void cleanConnectorMap()
Cleans the connector map from all connectors that are no longer attached to the application. This should only be called by the framework.


markDirty

public void markDirty(ClientConnector connector)
Mark the connector as dirty.

Parameters:
connector - The connector that should be marked clean.
See Also:
getDirtyConnectors()

markClean

public void markClean(ClientConnector connector)
Mark the connector as clean.

Parameters:
connector - The connector that should be marked clean.

markAllConnectorsDirty

public void markAllConnectorsDirty()
Mark all connectors in this root as dirty.


markAllConnectorsClean

public void markAllConnectorsClean()
Mark all connectors in this root as clean.


getDirtyConnectors

public Collection<ClientConnector> getDirtyConnectors()
Returns a collection of all connectors which have been marked as dirty.

The state and pending RPC calls for dirty connectors are sent to the client in the following request.

Returns:
A collection of all dirty connectors for this root. This list may contain invisible connectors.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.