Interface ClientContext
- All Superinterfaces:
CommonContext
- All Known Subinterfaces:
DesignerContext, VisionClientContext
- All Known Implementing Classes:
AbstractClientContext, ClientContextImpl, DesignerContextImpl, DesignerContextProxy
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String property, PropertyChangeListener pcl) deserialize(byte[] data, org.apache.log4j.Logger log) Convenience function to deserialize a gzipped byte array into a single object.Returns the current project's user sourceReturns the current project's default datasource nameReturns the current project's default Tag providerReturns the shared task execution manager for this client@Nullable ObjectReturns the running hook object that the module with the given ID contributed to this scope.Retrieve the list of all modules currently loaded in this contextReturns the appropriate named query rpc for the context.@Nullable ResourceCollectionReturns the project that this client is running.@NonNull StringThe name of the project this client will be / is runningReturns the RootPaneContainer that is currently the owner of the clientReturns the manager that provides access to Ignition's tag system.intReturns the rate at which Tags should be polled for updatescom.google.common.eventbus.EventBusThis event bus schedules event notification on the swing EDT.voidvoidremovePropertyChangeListener(String property, PropertyChangeListener pcl) Methods inherited from interface CommonContext
createDeserializer, getEdgeEditions, getEventBus, getExpressionFunctionFactory, getLicenseState, getLoggingManager, getScriptManager
-
Method Details
-
getTagManager
ClientTagManager getTagManager()Description copied from interface:CommonContextReturns the manager that provides access to Ignition's tag system.- Specified by:
getTagManagerin interfaceCommonContext
-
getExecutionManager
ExecutionManager getExecutionManager()Returns the shared task execution manager for this client -
getTagPollRate
int getTagPollRate()Returns the rate at which Tags should be polled for updates -
getDefaultDatasourceName
String getDefaultDatasourceName()Returns the current project's default datasource name -
getDefaultTagProviderName
String getDefaultTagProviderName()Returns the current project's default Tag provider -
getAuthProfileName
String getAuthProfileName()Returns the current project's user source -
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-
getRootPaneContainer
RootPaneContainer getRootPaneContainer()Returns the RootPaneContainer that is currently the owner of the client -
deserialize
Convenience function to deserialize a gzipped byte array into a single object. If multiple objects are found, they will be discarded. Warnings are logged to the given logger. If data is null or empty, null is returned.- Throws:
SerializationException
-
getModules
List<ModuleInfo> getModules()Retrieve the list of all modules currently loaded in this context -
getModule
Returns the running hook object that the module with the given ID contributed to this scope. This is the live hook instance, not itsClass. Modules use it to reach each other's APIs at runtime.The return type is
Objectbecause the hook type varies by scope — aClientModuleHookin a Vision client, aDesignerModuleHookin the Designer (seeDesignerContext#getModule(String), which narrows the return type accordingly). Callers narrow the result to an interface the target module publishes for this purpose — pattern matching covers the absent-module case in the same step:if (context.getModule(SFCModule.MODULE_ID) instanceof ClientStepRegistryProvider sfc) { var registry = sfc.getStepRegistry(); }A null result is the usual way to detect that an optional module is unavailable, so account for it unless the module is a hard dependency of yours.
- Parameters:
id- the module ID of the module whose hook you want.- Returns:
- the module's hook instance, or null if the module is not installed or contributes no hook to this scope.
-
getLocalizationManager
ClientLocalizationManager getLocalizationManager() -
getLaunchContext
LaunchContext getLaunchContext() -
getUIEventBus
com.google.common.eventbus.EventBus getUIEventBus()This event bus schedules event notification on the swing EDT. This is opposed to the event bus found onCommonContext.getEventBus(), which schedules event notification on a background thread.- Since:
- 7.9.2
-
getNamedQueryManager
NamedQueryManager getNamedQueryManager()Returns the appropriate named query rpc for the context. In the gateway and client, we only want to use named queries that have been saved. In the designer, we want to use the current version so that reports and bindings can be seen and used for testing before the project is saved.- Returns:
- The correct NamedQueryManager implementation for the scope.
- Since:
- 7.9.3
-
getProjectName
@NonNull String getProjectName()The name of the project this client will be / is running -
getProject
@Nullable ResourceCollection getProject()Returns the project that this client is running. Note that this may be null before the client is fully logged in and started, because the context is created before the project is downloaded.
-