Package com.e1c.g5.dt.applications
Interface IApplicationManager
- All Known Implementing Classes:
ApplicationManager
public interface IApplicationManager
The application manager is the core service of the application framework. It allows to get and introspect workspace
applications based on the registred application contributions.
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppllicationListener
(IApplicationListener listener) Adds the application listener to listen to application events.org.eclipse.core.runtime.IStatus
check
(IApplication application, ApplicationCheckUnknownStateTreatment whenUnknown, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Checks whether the application is ready to start.void
cleanup
(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Cleans up resources associated with the application.void
delete
(IApplication application, boolean unsynchronize) Deletes the specified application.findApplicationByInfobase
(InfobaseReference infobase) Finds an application that uses specified infobase.findApplicationByInfobaseAndProject
(InfobaseReference infobase, org.eclipse.core.resources.IProject project) Finds an application for the specified project that uses specified infobase.getApplication
(org.eclipse.core.resources.IProject project, String id) Returns the project application with the provided id.getApplicationArtifacts
(Object object) Returns a list of all found application artifacts for the provided application or application artifact.getApplications
(org.eclipse.core.resources.IProject project) Returns a list of all registered project applications.Returns a list of all registered application types.getDefaultApplication
(org.eclipse.core.resources.IProject project) Returns the default registered project application.Optional<org.eclipse.core.resources.IProject>
Returns the default application owner project if there is any.getDefaultUrlAccess
(IApplication application) Returns the default URL access instance for the provided application.getLifecycleState
(ILifecycleAware object) Returns the application lifecycle state for the provided application or lifecycle aware artifact.getPublishState
(IApplication application) Returns the application publish state for the provided application.getUrlAccesses
(IApplication application) Returns a list of all found URL access instances for the provided application.default ExecutionContext
launch
(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.open
(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.void
prepare
(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Prepares underlying infrastructure to be ready for interaction.publish
(IApplication application, PublishKind kind, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Publishes the application with the provided publish kind.void
Removes the application listener.void
setDefaultApplication
(org.eclipse.core.resources.IProject project, IApplication application) Sets the default registered project application.void
setDefaultUrlAccess
(IApplication application, IUrlAccess urlAccess) Sets the default URL access instance for the provided application.start
(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Runs application being developed.default ExecutionContext
stop
(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
getApplication
Optional<IApplication> getApplication(org.eclipse.core.resources.IProject project, String id) throws ApplicationException Returns the project application with the provided id.- Parameters:
project
- the project to get application for, cannot benull
id
- the id of the application, cannot benull
- Returns:
- the optional found application
- Throws:
ApplicationException
- if method call failed with some reason
-
getApplications
List<IApplication> getApplications(org.eclipse.core.resources.IProject project) throws ApplicationException Returns a list of all registered project applications.- Parameters:
project
- the project to get applications for, cannot benull
- Returns:
- a list of all registered project applications, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getDefaultProject
Returns the default application owner project if there is any.- Returns:
- the default application owner project if there is any
- Throws:
ApplicationException
- if method call failed with some reason
-
getDefaultApplication
Optional<IApplication> getDefaultApplication(org.eclipse.core.resources.IProject project) throws ApplicationException Returns the default registered project application.- Parameters:
project
- the project to get default application for, cannot benull
- Returns:
- the optional default registered project application
- Throws:
ApplicationException
- if method call failed with some reason
-
getDefaultUrlAccess
Returns the default URL access instance for the provided application.- Parameters:
application
- the application, cannot benull
- Returns:
- the optional default URL access instance for the provided application
- Throws:
ApplicationException
- if method call failed with some reason
-
getPublishState
Returns the application publish state for the provided application. May be unkown.- Parameters:
application
- the application to get state for, cannot benull
- Returns:
- the application publish state, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getLifecycleState
Returns the application lifecycle state for the provided application or lifecycle aware artifact. May be unkown.- Parameters:
object
- the object to get state for, cannot benull
- Returns:
- the application lifecycle state, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getApplicationTypes
Returns a list of all registered application types.- Returns:
- a list of all registered application types, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getApplicationArtifacts
Returns a list of all found application artifacts for the provided application or application artifact.- Parameters:
object
- the object to get application artifacts for, cannot benull
- Returns:
- a list of all found application artifacts, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getUrlAccesses
Returns a list of all found URL access instances for the provided application. May return the application itself if it is an instance ofIUrlAccess
.- Parameters:
object
- the object to get URL access instances for, cannot benull
- Returns:
- a list of all found URL access instances, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
setDefaultApplication
void setDefaultApplication(org.eclipse.core.resources.IProject project, IApplication application) throws ApplicationException Sets the default registered project application.- Parameters:
project
- the project to get application for, cannot benull
application
- the default project application to register for the project ornull
to reset- Throws:
ApplicationException
- if method call failed with some reason
-
setDefaultUrlAccess
void setDefaultUrlAccess(IApplication application, IUrlAccess urlAccess) throws ApplicationException Sets the default URL access instance for the provided application.- Parameters:
application
- the application, cannot benull
the
- default URL access instance to register for the provided application ornull
to reset- Throws:
ApplicationException
- if method call failed with some reason
-
check
org.eclipse.core.runtime.IStatus check(IApplication application, ApplicationCheckUnknownStateTreatment whenUnknown, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Checks whether the application is ready to start. Such readiness check might include checking that related infobase configuration has not been changed outside of EDT. If application's project has extensions then those extensions are checked as well.- Parameters:
application
- the application to check, cannot benull
whenUnknown
- Indicates how to treat situation when previous infobase state is not known and so cannot determine if there are changes in infobase. Must not benull
.context
- Context with start parameters. It must containExecutionContext.ACTIVE_SHELL_NAME
with the shell to be used for interaction with a user. Must not benull
.monitor
- the progress monitor to report progress to, cannot benull
- Returns:
IStatus.OK
if application is ready to be started,IStatus.CANCEL
if user cancells operation,IStatus.ERROR
if application is not ready to be started.- Throws:
ApplicationException
- if thecontext
does not specifyExecutionContext.ACTIVE_SHELL_NAME
or pulling changes from the associated infobase fails.
-
publish
PublishState publish(IApplication application, PublishKind kind, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Publishes the application with the provided publish kind.- Parameters:
application
- the application to publish, cannot benull
kind
- the publish kind to use, cannot benull
context
- the execution context, cannot benull
monitor
- the progress monitor to report progress to ornull
if report is not desired- Returns:
- the publication state after execution, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
prepare
void prepare(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Prepares underlying infrastructure to be ready for interaction. Some applications might consist in more than just a client (which can bestart(com.e1c.g5.dt.applications.IApplication, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
-ed). Those type of applications might require additional set up for the interaction with them to function properly. For example, a server application might require a server to be started before a client application can bepublish(com.e1c.g5.dt.applications.IApplication, com.e1c.g5.dt.applications.PublishKind, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
-ed or clientstart(com.e1c.g5.dt.applications.IApplication, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
-ed. Such preparation work is performed by the method. The opposite work of undoing such preparation should be done withcleanup(com.e1c.g5.dt.applications.IApplication, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
. The application preparation for regular run and for debug run might be significatly different. The caller must specify launch mode to be the same as it will specify when actually starting application in the future. However, it is up to the application if it will honor or ignore the mode and if it will re-prepare if it is already prepared for another mode or the current application state is good enough for the desired launch mode. The current thread is blocked until preparation is complete (for example, server start finishes). Since this is a long running operation, it might be inappripriate to run it from UI thread. Consider usingorg.eclipse.jface.dialogs.ProgressMonitorDialog
with fork mode enabled.- Parameters:
application
- the application to prepare, cannot benull
launchMode
- Desired future application start mode. See org.eclipse.debug.core.ILaunchManager.RUN_MODE and org.eclipse.debug.core.ILaunchManager.DEBUG_MODE. Must not benull
.context
- Context containing parameters affecting application preparation. The context could be modified as a result of the call and should be used when starting clients. For example,ExecutionContext.DEBUG_TARGET
andExecutionContext.DEBUG_URL
might be added/updated to reflect application settings when preparing for debug mode. Must not benull
.monitor
- the progress monitor to report progress to ornull
if report is not desired- Throws:
ApplicationException
- if method call failed with some reason
-
launch
@Deprecated(forRemoval=true) default ExecutionContext launch(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
ApplicationException
-
cleanup
void cleanup(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Cleans up resources associated with the application. The method does not stop client application being developed. Instead, it undoes preparation work that has been previously done byprepare(com.e1c.g5.dt.applications.IApplication, java.lang.String, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
. For example, if for a server application a server itself has been started byprepare(com.e1c.g5.dt.applications.IApplication, java.lang.String, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
and then a client application has been started bystart(com.e1c.g5.dt.applications.IApplication, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
then the method might stop that previously started server once it is not needed anymore. This can change lifecycle state of the application but should have no effect on application synchronization/equality/publish state. Cleanup is a temporary action and should not be as desctructive asdelete(com.e1c.g5.dt.applications.IApplication, boolean)
. If the application has not been previouslyprepare(com.e1c.g5.dt.applications.IApplication, java.lang.String, com.e1c.g5.dt.applications.ExecutionContext, org.eclipse.core.runtime.IProgressMonitor)
d then it still can be cleaned up without generating an error. The current thread is blocked until operation is finished. Since this is a long running operation, it might be inappripriate to run it from UI thread. Consider usingorg.eclipse.jface.dialogs.ProgressMonitorDialog
with fork mode enabled.- Parameters:
application
- the application to stop, cannot benull
context
- the execution context, cannot benull
monitor
- the progress monitor to report progress to ornull
if report is not desired- Throws:
ApplicationException
- if method call failed with some reason
-
stop
@Deprecated(forRemoval=true) default ExecutionContext stop(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
ApplicationException
-
start
Optional<Process> start(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Runs application being developed. The method runs client application being developed and represented by the specifiedIApplication
. Some application types (for example, server applications) require that preliminary preparation is performed before application being developed can be run. For this purpose,prepare(IApplication, String, ExecutionContext, IProgressMonitor)
should be used beforehand.- Parameters:
application
- the application to start, cannot benull
context
- the execution context, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
- Returns:
- the optional application client system process, may be empty if application is web for example
- Throws:
ApplicationException
- if method call failed with some reason
-
open
@Deprecated(forRemoval=true) default Optional<Process> open(IApplication application, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws ApplicationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
ApplicationException
-
addAppllicationListener
Adds the application listener to listen to application events.- Parameters:
listener
- the application listener, cannot benull
-
removeAppllicationListener
Removes the application listener.- Parameters:
listener
- the application listener, cannot benull
-
delete
Deletes the specified application.- Parameters:
application
- Application to be deleted. Must not benull
.unsynchronize
-true
if synchronization state is to be deleted orfalse
is to keep synchronization state.- Throws:
ApplicationException
- If the specified application could not be deleted for whatever reason.
-
findApplicationByInfobase
Optional<IApplication> findApplicationByInfobase(InfobaseReference infobase) throws ApplicationException Finds an application that uses specified infobase. If project is known then consider usingfindApplicationByInfobaseAndProject(com._1c.g5.v8.dt.platform.services.model.InfobaseReference, org.eclipse.core.resources.IProject)
which could much faster.- Parameters:
infobase
- Infobase for which to find application. Must not benull
.- Returns:
- Application that uses specified infobase or an empty value if infobase is not used by any application.
Never
null
. - Throws:
ApplicationException
- If an error occured while searching for matching application.
-
findApplicationByInfobaseAndProject
Optional<IApplication> findApplicationByInfobaseAndProject(InfobaseReference infobase, org.eclipse.core.resources.IProject project) throws ApplicationException Finds an application for the specified project that uses specified infobase. The method is similar tofindApplicationByInfobase(com._1c.g5.v8.dt.platform.services.model.InfobaseReference)
but could be much faster.- Parameters:
infobase
- Infobase for which to search application. Must not benull
.project
- Project for which to search application. Must not benull
.- Returns:
- Application that uses specified infobase and project
or an empty value if infobase is not used by any application in the specified project.
Never
null
. - Throws:
ApplicationException
- If an error occured while searching for matching application.
-
prepare(IApplication,String,ExecutionContext,IProgressMonitor)
instead