Class AbstractClientConnector
- All Implemented Interfaces:
ClientConnector,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
- Direct Known Subclasses:
AbstractComponent
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddExtension(Extension extension) Deprecated.not supported - calling this does nothing but logs a warning in development modecom.vaadin.flow.shared.RegistrationAdd a listener for legacy connector attach events.com.vaadin.flow.shared.RegistrationAdd a listener for connector detach events.com.vaadin.flow.shared.RegistrationaddListener(Class<?> eventType, com.vaadin.flow.function.SerializableEventListener listener, Method method) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected com.vaadin.flow.shared.RegistrationaddListener(String eventIdentifier, Class<?> eventType, com.vaadin.flow.function.SerializableEventListener listener, Method method) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected voidaddMethodInvocationToQueue(String interfaceName, Method method, Object[] parameters) Deprecated.not supported - calling this does nothing but logs a warning in development modevoidattach()Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).voidbeforeClientResponse(boolean initial) Called before the response is written to client side.protected SharedStateDeprecated.not supported - calling this does nothing but logs a warning in development modevoiddetach()Notifies the connector that it is detached from its VaadinSession.static Iterable<? extends ClientConnector>getAllChildrenIterable(ClientConnector connector) Deprecated.not supported - calling this does nothing but logs a warning in development modeDeprecated.not supported - calling this does nothing but logs a warning in development mode*com.vaadin.flow.server.ErrorHandlerDeprecated.not supported - calling this does nothing but logs a warning in development modeDeprecated.not supported - calling this does nothing but logs a warning in development modeprotected ResourcegetResource(String key) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected com.vaadin.flow.server.VaadinSessionFinds theVaadinSessionto which this connector belongs.protected SharedStategetState()Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected SharedStategetState(boolean markAsDirty) Deprecated.not supported - calling this does nothing but logs a warning in development modebooleanhandleConnectorRequest(com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, String path) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected booleanhasListeners(Class<? extends com.vaadin.flow.component.ComponentEvent> eventType) Checks if the givenComponentEventtype is listened for this component.booleanDelegates toComponent.isAttached().booleanChecks if the communicator is enabled.voidMarks that this classic component's state might have changed.voidCauses this classic component and all child components below it to be marked as dirty.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected <T extends ServerRpc>
voidregisterRpc(T implementation) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected <T extends ServerRpc>
voidregisterRpc(T implementation, Class<T> rpcInterfaceType) Deprecated.not supported - calling this does nothing but logs a warning in development modevoidremoveExtension(Extension extension) Deprecated.not supported - calling this does nothing but logs a warning in development modevoidsetErrorHandler(com.vaadin.flow.server.ErrorHandler errorHandler) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected voidsetResource(String key, Resource resource) Deprecated.not supported - calling this does nothing but logs a warning in development modeprotected voidupdateDiffstate(String propertyName, elemental.json.JsonValue newValue) Deprecated.not supported - calling this does nothing but logs a warning in development modeMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
AbstractClientConnector
public AbstractClientConnector()
-
-
Method Details
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
beforeClientResponse
public void beforeClientResponse(boolean initial) Description copied from interface:ClientConnectorCalled before the response is written to client side. Gives the legacy connector an opportunity to set computed/dynamic state values.This is implemented for the legacy components to keep consistent behavior and e.g. legaze size calculations working.
NOTE: the parameter
initialisfalsewhen the component is attached again to a newUIwhenPreserveOnRefreshis used.- Specified by:
beforeClientResponsein interfaceClientConnector- Parameters:
initial-trueif the client-side connector will be created and initialized after this method has been invoked.falseif there is already an initialized client-side connector.
-
markAsDirty
public void markAsDirty()Description copied from interface:ClientConnectorMarks that this classic component's state might have changed. When the framework is about to send new data to the client-side, it will runClientConnector.beforeClientResponse(boolean)for all legacy components that are marked as dirty.- Specified by:
markAsDirtyin interfaceClientConnector
-
markAsDirtyRecursive
public void markAsDirtyRecursive()Description copied from interface:ClientConnectorCauses this classic component and all child components below it to be marked as dirty.This should only be used in special cases, e.g when the state of a descendant depends on the state of an ancestor.
This will go through the whole component subtree, including any non-legacy components.
- Specified by:
markAsDirtyRecursivein interfaceClientConnector- See Also:
-
addLegacyAttachListener
public com.vaadin.flow.shared.Registration addLegacyAttachListener(ClientConnector.AttachListener listener) Description copied from interface:ClientConnectorAdd a listener for legacy connector attach events. This could be migrated toAttachNotifier.addAttachListener(ComponentEventListener).- Specified by:
addLegacyAttachListenerin interfaceClientConnector- Parameters:
listener- the listener to add- Returns:
- Registration for unregistering the listener
-
addLegacyDetachListener
public com.vaadin.flow.shared.Registration addLegacyDetachListener(ClientConnector.DetachListener listener) Description copied from interface:ClientConnectorAdd a listener for connector detach events. This could be migrated toDetachNotifier.addDetachListener(ComponentEventListener)- Specified by:
addLegacyDetachListenerin interfaceClientConnector- Parameters:
listener- the listener to add- Returns:
- Registration for unregistering the listener
-
hasListeners
Checks if the givenComponentEventtype is listened for this component.- Parameters:
eventType- the event type to be checked- Returns:
- true if a listener is registered for the given event type
-
attach
public void attach()Description copied from interface:ClientConnectorNotifies the connector that it is connected to a VaadinSession (and therefore also to a UI).The caller of this method is
ComponentUtil.onComponentAttach(Component, boolean)} if the parent is itself already attached to the session. If not, it's called when the parent is attached to the session. This method is always called before the connector's data is sent to the client-side for the first time.The attachment logic is implemented in
AbstractClientConnector.- Specified by:
attachin interfaceClientConnector
-
detach
public void detach()Description copied from interface:ClientConnectorNotifies the connector that it is detached from its VaadinSession.- Specified by:
detachin interfaceClientConnector
-
isAttached
public boolean isAttached()Delegates toComponent.isAttached(). Checks if the connector is attached to a VaadinSession.- Specified by:
isAttachedin interfaceClientConnector- Overrides:
isAttachedin classcom.vaadin.flow.component.Component- Returns:
- true if the component is attached to an active UI.
-
isConnectorEnabled
public boolean isConnectorEnabled()Description copied from interface:ClientConnectorChecks if the communicator is enabled. An enabled communicator is allowed to receive messages from its counter-part.- Specified by:
isConnectorEnabledin interfaceClientConnector- Returns:
- true if the connector can receive messages, false otherwise
-
getSession
protected com.vaadin.flow.server.VaadinSession getSession()Finds theVaadinSessionto which this connector belongs. If the connector has not been attached,nullis returned.- Returns:
- The connector's session, or
nullif not attached
-
addExtension
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
extension- extension
-
addListener
@Deprecated public com.vaadin.flow.shared.Registration addListener(Class<?> eventType, com.vaadin.flow.function.SerializableEventListener listener, Method method) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
eventType- event typelistener- listenermethod- method- Returns:
- registration that does nothing
-
addListener
@Deprecated protected com.vaadin.flow.shared.Registration addListener(String eventIdentifier, Class<?> eventType, com.vaadin.flow.function.SerializableEventListener listener, Method method) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
eventIdentifier- event identifiereventType- event typelistener- listenermethod- method- Returns:
- a registration that does nothing
-
addMethodInvocationToQueue
@Deprecated protected void addMethodInvocationToQueue(String interfaceName, Method method, Object[] parameters) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
interfaceName- interface namemethod- methodparameters- parameters
-
createState
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Returns:
- placeholder shared state
-
getAllChildrenIterable
@Deprecated public static Iterable<? extends ClientConnector> getAllChildrenIterable(ClientConnector connector) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
connector- connector- Returns:
- empty iterator
-
getConnectorId
Deprecated.not supported - calling this does nothing but logs a warning in development mode*Not supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Returns:
- empty string
-
getErrorHandler
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Returns:
- error handler that does nothing
-
getExtensions
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Returns:
- an empty collection
-
getResource
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
key- key- Returns:
- a fake resource object
-
getState
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Returns:
- placeholder shared state
-
getState
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
markAsDirty- mark as dirty- Returns:
- placeholder shared state
-
handleConnectorRequest
@Deprecated public boolean handleConnectorRequest(com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, String path) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
request- requestresponse- responsepath- path- Returns:
- false
-
registerRpc
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Type Parameters:
T- type- Parameters:
implementation- implementation
-
registerRpc
@Deprecated protected <T extends ServerRpc> void registerRpc(T implementation, Class<T> rpcInterfaceType) Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Type Parameters:
T- type- Parameters:
implementation- implementationrpcInterfaceType- rpc interface type
-
removeExtension
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
extension- extension
-
setErrorHandler
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
errorHandler- error handler
-
setResource
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
key- keyresource- resource
-
updateDiffstate
Deprecated.not supported - calling this does nothing but logs a warning in development modeNot supported. See Classic Component Pack documentation in https://vaadin.com/docs/latest/flow/upgrading/legacy-component-pack for mitigation options.- Parameters:
propertyName- property namenewValue- new value
-