|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csstudio.startup.application.Application
public class Application
Application
is the default implementation of the
IApplication
interface which acts a an entry point for the Control
System Studio. This class uses several extension points through which the
user can provide his own code how certain aspects should be handled during
the star-up of the application or if they should be handled at all.
This implementation defines the action and the sequence in which the
extension points will be executed. For details see
#startApplication(IApplicationContext, Display)
.
Field Summary | |
---|---|
protected java.util.HashMap<java.lang.Class<? extends CSSStartupExtensionPoint>,CSSStartupExtensionPoint[]> |
configurationElements
The map of all loaded extension points. |
protected java.util.Map<java.lang.String,java.lang.Object> |
parameters
The list of all parameters read at start-up and any other parameters which were created later on during the execution of this application |
Constructor Summary | |
---|---|
Application()
|
Method Summary | ||
---|---|---|
protected java.lang.Object |
applyLocaleSetting(IApplicationContext context)
Applies the locale setting. |
|
protected java.lang.Object |
closeProjects(Display display,
IApplicationContext context)
Loads the ProjectExtPoint and executes the
ProjectExtPoint#closeProjects(IApplicationContext) method. |
|
protected void |
closeWorkbench()
This method is called as the last executed action when the application is stopped. |
|
protected void |
errorExecutingExtensionPoint(java.lang.String name,
java.lang.Throwable t)
This is a utility method which logs the error that happens during the execution of one of the extension points. |
|
protected
|
getExtensionPoints(java.lang.Class<T> type,
java.lang.String name)
Gathers the loaded extension points which match the parameter criteria. |
|
protected java.lang.Object |
openProjects(Display display,
IApplicationContext context)
Loads the ProjectExtPoint and executes the
ProjectExtPoint#openProjects(IApplicationContext) method. |
|
protected java.lang.Object |
promptForLogin(Display display,
IApplicationContext context)
Loads the LoginExtPoint and executes the
LoginExtPoint.login(Display, IApplicationContext, Map) method. |
|
protected java.lang.Object |
promptForWorkspace(Display display,
IApplicationContext context)
Loads the WorkspaceExtPoint and executes
WorkspaceExtPoint.promptForWorkspace(Display, IApplicationContext, Map)
method. |
|
protected java.util.Map<java.lang.String,java.lang.Object> |
readStartupParameters(Display display,
IApplicationContext context)
Reads all the startup parameters and returns them in a map. |
|
java.lang.Object |
start(IApplicationContext context)
|
|
protected java.lang.Object |
startApplication(IApplicationContext context,
Display display,
OpenDocumentEventProcessor openDocProcessor)
Initializes the application. |
|
protected java.lang.Object |
startServices(Display display,
IApplicationContext context)
Loads the ServicesStartupExtPoint and executes
ServicesStartupExtPoint#startServices(IApplicationContext) . |
|
void |
stop()
|
|
protected void |
stopApplication()
Loads all ShutDownExtPoint s and executes the
ShutDownExtPoint#beforeShutDown() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,java.lang.Object> parameters
protected java.util.HashMap<java.lang.Class<? extends CSSStartupExtensionPoint>,CSSStartupExtensionPoint[]> configurationElements
getExtensionPoints(Class, String)
).
Constructor Detail |
---|
public Application()
Method Detail |
---|
public java.lang.Object start(IApplicationContext context) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object startApplication(IApplicationContext context, Display display, OpenDocumentEventProcessor openDocProcessor) throws java.lang.Exception
readStartupParameters(Display, IApplicationContext)
applyLocaleSetting(IApplicationContext)
promptForLogin(Display, IApplicationContext)
promptForWorkspace(Display, IApplicationContext)
startServices(Display, IApplicationContext)
openProjects(Display, IApplicationContext)
#beforeWorkbenchStart(Display, IApplicationContext)
#startWorkbench(Display, IApplicationContext)
#afterWorkbenchStart(Display, IApplicationContext)
closeProjects(Display, IApplicationContext)
The default implementations of the methods listed above make the calls
to appropriate extension points. If one of the extension points returns
an exit code this method will terminate the operation and return that
code immediately. If everything went the appropriate exit code as returned
by the #startWorkbench(Display, IApplicationContext)
is returned.
context
- this application's contextdisplay
- the display of the applicationopenDocProcessor
-
#startWorkbench(Display, IApplicationContext)
is returned by
this method.
java.lang.Exception
- if anything went wrong during the execution of any of the segmentspublic void stop()
protected java.lang.Object applyLocaleSetting(IApplicationContext context) throws java.lang.Exception
LocaleSettingsExtPoint
and executes
the LocaleSettingsExtPoint#applyLocaleSetting()
method.
context
- the context of this application
java.lang.Exception
protected java.util.Map<java.lang.String,java.lang.Object> readStartupParameters(Display display, IApplicationContext context) throws java.lang.Exception
display
- the display of the applicationcontext
- the application's context
java.lang.Exception
protected java.lang.Object promptForLogin(Display display, IApplicationContext context) throws java.lang.Exception
LoginExtPoint
and executes the
LoginExtPoint.login(Display, IApplicationContext, Map)
method.
It is expected that after the execution of this method the user is logged
into the application and has the appropriate access rights requested by the
setup of this application.
display
- the display of this applicationcontext
- the application's context
java.lang.Exception
protected java.lang.Object promptForWorkspace(Display display, IApplicationContext context) throws java.lang.Exception
WorkspaceExtPoint
and executes
WorkspaceExtPoint.promptForWorkspace(Display, IApplicationContext, Map)
method. After the execution the workspace for the application should be selected.
There can be only one extension point of this type in the application. If no
extension points are defined the application will load the default workspace as
specified and by this rcp.
display
- the display of this applicationcontext
- this application's context
java.lang.Exception
protected java.lang.Object startServices(Display display, IApplicationContext context) throws java.lang.Exception
ServicesStartupExtPoint
and executes
ServicesStartupExtPoint#startServices(IApplicationContext)
.
display
- the display of this applicationcontext
- this application's context
java.lang.Exception
protected java.lang.Object openProjects(Display display, IApplicationContext context) throws java.lang.Exception
ProjectExtPoint
and executes the
ProjectExtPoint#openProjects(IApplicationContext)
method.
display
- the display of this applicationcontext
- this application's context
java.lang.Exception
protected java.lang.Object closeProjects(Display display, IApplicationContext context) throws java.lang.Exception
ProjectExtPoint
and executes the
ProjectExtPoint#closeProjects(IApplicationContext)
method.
display
- the display of this applicationcontext
- this application's context
java.lang.Exception
protected void stopApplication()
ShutDownExtPoint
s and executes the
ShutDownExtPoint#beforeShutDown()
method.
protected void closeWorkbench()
protected <T extends CSSStartupExtensionPoint> T[] getExtensionPoints(java.lang.Class<T> type, java.lang.String name)
T
- the type of the extension point requestedtype
- the interface/implementation that defines this typename
- the name of the extension point element ("locale", "project", "startupParameters", ...)
protected void errorExecutingExtensionPoint(java.lang.String name, java.lang.Throwable t)
name
- the name of the extension pointt
- the exception that occurred during execution (could be null)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |