Package com.caplin.console
Interface Console
public interface Console
Defines the interface exposed by the Console that is available for Views
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsoleListener(ConsoleListener listener) Adds a listener for console eventsgetGlobalProperty(String name) Gets a global property.Gets the JMX MBeanServerConnection for the current connectiongetRegisteredObject(String objectName) Gets the value of a previously registered objectGets the current status message displayed by the consolebooleanReturns whether the given view is set as dirty (i.e.; has changed data that needs saving back to persistent XML)voidpostMessage(String toViewClassName, String messageId, Map messageData) Posts a message to the given view, used for inter-view communicationvoidregisterObject(String objectName, Object object) Registers an object with the console by name, can be used by views to store state at the console level and share information between viewsvoidReload the console - this should re-read the configuration.voidSets a flag to indicate that the given view is dirty (i.e.; has changed data the needs saving back to pesistent XML).voidsetGlobalProperty(String name, Object value) Sets a global property.voidsetStatusMessage(String message) Sets the consoles current status message stringbooleanShows the given view, the view must be defined in the console xml configuration file
-
Method Details
-
getJMXConnection
MBeanServerConnection getJMXConnection()Gets the JMX MBeanServerConnection for the current connection- Returns:
- the current MBeanServerConnection
-
getStatusMessage
String getStatusMessage()Gets the current status message displayed by the console- Returns:
- the status message string
-
setStatusMessage
Sets the consoles current status message string- Parameters:
message- the status message string to set
-
isDirty
Returns whether the given view is set as dirty (i.e.; has changed data that needs saving back to persistent XML)- Parameters:
view- the view to check- Returns:
- true if view has dirty flag set
-
setDirty
Sets a flag to indicate that the given view is dirty (i.e.; has changed data the needs saving back to pesistent XML).- Parameters:
view- the view that is dirtydirty- true to set the flag, false to clear
-
addConsoleListener
Adds a listener for console events- Parameters:
listener- the ConsoleListener
-
getRegisteredObject
Gets the value of a previously registered object- Parameters:
objectName- the name of the object to lookup- Returns:
- the returned object of null if not found
-
registerObject
Registers an object with the console by name, can be used by views to store state at the console level and share information between views- Parameters:
objectName- the name of the object to storeobject- the object to store
-
postMessage
Posts a message to the given view, used for inter-view communication- Parameters:
toViewClassName- the class name of the view to receive the messagemessageId- a String identifying the messagemessageData- a Map of name, value pairs representing messages data
-
showView
Shows the given view, the view must be defined in the console xml configuration file- Parameters:
toViewClassName- The view to show.- Returns:
- true if view shown
-
reloadConsole
void reloadConsole()Reload the console - this should re-read the configuration. -
setGlobalProperty
Sets a global property. A global property is a way for the various parts of the CMC to share data. They can be set or accessed by the CMC, by any child console or any tabbedViewwithin any of those child consoles.- Parameters:
name- identifies the global property being setvalue- the value to associate with the name parameter
-
getGlobalProperty
Gets a global property. A global property is a way for the various parts of the CMC to share data. They can be set or accessed by the CMC, by any child console or any tabbedViewwithin any of those child consoles.- Parameters:
name- identifies which global property to get.- Returns:
- the value from the global properties that is associated with the parameter name or null if there is no property associated with the name.
-