Package com.vaadin.client
Class Registry
- java.lang.Object
-
- com.vaadin.client.Registry
-
- Direct Known Subclasses:
DefaultRegistry
public class Registry extends Object
A registry of singleton instances, such asServerRpcQueue, which can be looked up based on their class.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description Registry()Creates a new empty registry.
-
Method Summary
-
-
-
Constructor Detail
-
Registry
public Registry()
Creates a new empty registry.Use
set(Class, Object)to populate the registry.
-
-
Method Detail
-
set
protected final <T> void set(Class<T> type, T instance)
Stores an instance of the given type.Note that instances by default are considered final, and you are not allowed to update an instance of any given type manually. In case instance is allowed to be recreated use
set(Class, Supplier).- Type Parameters:
T- the type- Parameters:
type- the type to storeinstance- the instance to store
-
set
protected final <T> void set(Class<T> type, Supplier<T> instanceSupplier)
Stores an instance of the given type.Note that instances by default are considered final, and you are not allowed to update an instance of any given type manually. Uses resettable supplier to allow Registry to recreate given instances.
- Type Parameters:
T- the type- Parameters:
type- the type to storeinstanceSupplier- new instances supplier if given registry entry can be reset
-
get
protected final <T> T get(Class<T> type)
Gets an instance of the given type from the lookup table.- Type Parameters:
T- the class type- Parameters:
type- the type to get- Returns:
- the stored instance or null if no instance has been stored
-
getMessageSender
public MessageSender getMessageSender()
Gets theMessageSendersingleton.- Returns:
- the
MessageSendersingleton
-
getMessageHandler
public MessageHandler getMessageHandler()
Gets theMessageHandlersingleton.- Returns:
- the
MessageHandlersingleton
-
getApplicationConnection
public ApplicationConnection getApplicationConnection()
Gets theApplicationConnectionsingleton.- Returns:
- the
ApplicationConnectionsingleton
-
getHeartbeat
public Heartbeat getHeartbeat()
Gets theHeartbeatsingleton.- Returns:
- the
Heartbeatsingleton
-
getConnectionStateHandler
public ConnectionStateHandler getConnectionStateHandler()
Gets theConnectionStateHandlersingleton.- Returns:
- the
ConnectionStateHandlersingleton
-
getServerRpcQueue
public ServerRpcQueue getServerRpcQueue()
Gets theServerRpcQueuesingleton.- Returns:
- the
ServerRpcQueuesingleton
-
getApplicationConfiguration
public ApplicationConfiguration getApplicationConfiguration()
Gets theApplicationConfigurationsingleton.- Returns:
- the
ApplicationConfigurationsingleton
-
getStateTree
public StateTree getStateTree()
Gets theStateTreesingleton.- Returns:
- the
StateTreesingleton
-
getPushConfiguration
public PushConfiguration getPushConfiguration()
Gets thePushConfigurationsingleton.- Returns:
- the
PushConfigurationsingleton
-
getXhrConnection
public XhrConnection getXhrConnection()
Gets theXhrConnectionsingleton.- Returns:
- the
XhrConnectionsingleton
-
getURIResolver
public URIResolver getURIResolver()
Gets theURIResolversingleton.- Returns:
- the
URIResolversingleton
-
getDependencyLoader
public DependencyLoader getDependencyLoader()
Gets theDependencyLoadersingleton.- Returns:
- the
DependencyLoadersingleton
-
getSystemErrorHandler
public SystemErrorHandler getSystemErrorHandler()
Gets theSystemErrorHandlersingleton.- Returns:
- the
SystemErrorHandlersingleton
-
getUILifecycle
public UILifecycle getUILifecycle()
Gets theUILifecyclesingleton.- Returns:
- the
UILifecyclesingleton
-
getRequestResponseTracker
public RequestResponseTracker getRequestResponseTracker()
Gets theRequestResponseTrackersingleton.- Returns:
- the
RequestResponseTrackersingleton
-
getReconnectConfiguration
public ReconnectConfiguration getReconnectConfiguration()
Gets theReconnectConfigurationsingleton.- Returns:
- the
ReconnectConfigurationsingleton
-
getExecuteJavaScriptProcessor
public ExecuteJavaScriptProcessor getExecuteJavaScriptProcessor()
Gets theExecuteJavaScriptProcessorsingleton.- Returns:
- the
ExecuteJavaScriptProcessorsingleton
-
getServerConnector
public ServerConnector getServerConnector()
Gets theServerConnectorsingleton.- Returns:
- the
ServerConnectorsingleton
-
getResourceLoader
public ResourceLoader getResourceLoader()
Gets theResourceLoadersingleton.- Returns:
- the
ResourceLoadersingleton
-
getConstantPool
public ConstantPool getConstantPool()
Gets theConstantPoolsingleton.- Returns:
- the
ConstantPoolsingleton
-
getScrollPositionHandler
public ScrollPositionHandler getScrollPositionHandler()
Gets theScrollPositionHandlersingleton.- Returns:
- the
ScrollPositionHandlersingleton
-
getExistingElementMap
public ExistingElementMap getExistingElementMap()
Gets theExistingElementMapsingleton.- Returns:
- the
ExistingElementMapsingleton
-
getInitialPropertiesHandler
public InitialPropertiesHandler getInitialPropertiesHandler()
Gets theInitialPropertiesHandlersingleton.- Returns:
- the
InitialPropertiesHandlersingleton
-
reset
public void reset()
Deletes and recreates resettable instances of registry singletons.
-
-