diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-07-27 14:36:23 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-07-27 14:38:15 +0300 |
commit | 7f75d0f4cfd93d30bd5209a7fe02c819ee6ac614 (patch) | |
tree | 32dca6d9bfdef899aee0e64f78b4ef8802595f8f /src/com/vaadin/shared/Connector.java | |
parent | 01c312a4a7b457bfb89c19e804d403537974026f (diff) | |
download | vaadin-framework-7f75d0f4cfd93d30bd5209a7fe02c819ee6ac614.tar.gz vaadin-framework-7f75d0f4cfd93d30bd5209a7fe02c819ee6ac614.zip |
Move classes common to client and server to com.vaadin.shared.* (#8934)
Diffstat (limited to 'src/com/vaadin/shared/Connector.java')
-rw-r--r-- | src/com/vaadin/shared/Connector.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/com/vaadin/shared/Connector.java b/src/com/vaadin/shared/Connector.java new file mode 100644 index 0000000000..e09d4d51b7 --- /dev/null +++ b/src/com/vaadin/shared/Connector.java @@ -0,0 +1,58 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.shared; + +import java.io.Serializable; + +import com.vaadin.shared.communication.SharedState; +import com.vaadin.terminal.gwt.client.ServerConnector; +import com.vaadin.terminal.gwt.server.ClientConnector; + +/** + * Interface implemented by all classes that are capable of communicating with + * the server or the client side. + * <p> + * A connector consists of a shared state (server sets the state and + * automatically communicates changes to the client) and the possibility to do + * RPC calls either from the server to the client or from the client to the + * server. + * </p> + * <p> + * No classes should implement this interface directly, client side classes + * wanting to communicate with server side should implement + * {@link ServerConnector} and server side classes should implement + * {@link ClientConnector}. + * </p> + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0.0 + */ +public interface Connector extends Serializable { + /** + * Gets the current shared state of the connector. + * + * @since 7.0. + * @return state The shared state object. Can be any sub type of + * {@link SharedState}. Never null. + */ + public SharedState getState(); + + /** + * Returns the id for this connector. This is set by the framework and does + * not change during the lifetime of a connector. + * + * @return The id for the connector. + */ + public String getConnectorId(); + + /** + * Gets the parent connector of this connector, or <code>null</code> if the + * connector is not attached to any parent. + * + * @return the parent connector, or <code>null</code> if there is no parent. + */ + public Connector getParent(); + +} |