Interface IApplicationBehaviourDelegate
- All Known Implementing Classes:
InfobaseApplicationBehaviourDelegate,ServerApplicationBehaviourDelegate
public interface IApplicationBehaviourDelegate
Application type specific implementation of application operations.
Usually, application code should use
IApplicationManager
which could then delegate to instances of IApplicationBehaviourDelegate
for application type specific behaviour.-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.core.runtime.IStatuscheck(IApplication application, ApplicationCheckUnknownStateTreatment whenUnknown, ExecutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Checks whether the application is ready to start.voidcleanup(IApplication application, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) Cleans up resources associated with the application.voiddelete(IApplication application, boolean unsynchronize) Deletes the specified application.voidinitialize(IApplicationProvisionNotifier notifier, IApplicationType type) Initializes the application behaviour delegate with the registered application type and provision notifier.default ExecutionContextlaunch(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.voidonStateChanged(IApplication application, LifecycleState state) Called when application state has been changed.voidprepare(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) Prepares underlying infrastructure to be ready for interaction.publish(IApplication application, PublishKind kind, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) Publishes the application with the provided publish kind.default ExecutionContextstop(IApplication application, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
initialize
void initialize(IApplicationProvisionNotifier notifier, IApplicationType type) throws ApplicationException Initializes the application behaviour delegate with the registered application type and provision notifier.- Parameters:
notifier- the application provision notifier, cannot benulltype- the application type, cannot benull- Throws:
ApplicationException- if method call failed with some reason
-
publish
PublishState publish(IApplication application, PublishKind kind, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) throws ApplicationException Publishes the application with the provided publish kind.- Parameters:
application- the application to publish, cannot benullkind- the publish kind to use, cannot benullcontext- the execution context, cannot benullmonitor- the progress monitor to report progress to, cannot benull- Returns:
- the publication state after execution, never
null - 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 benullwhenUnknown- 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_NAMEwith 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.OKif application is ready to be started,IStatus.CANCELif user cancells operation,IStatus.ERRORif application is not ready to be started.- Throws:
ApplicationException- if thecontextdoes not specifyExecutionContext.ACTIVE_SHELL_NAMEor pulling changes from the associated infobase fails.
-
prepare
void prepare(IApplication application, String launchMode, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) throws ApplicationException Prepares underlying infrastructure to be ready for interaction. Some applications might consist in more than just a client. 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.SubMonitor)-ed or client started. 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.SubMonitor). 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.ProgressMonitorDialogwith fork mode enabled.- Parameters:
application- the application to prepare, cannot benulllaunchMode- 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_TARGETandExecutionContext.DEBUG_URLmight be added/updated to reflect application settings when preparing for debug mode. Must not benull.monitor- the progress monitor to report progress to ornullif 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.SubMonitor 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.SubMonitor 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.SubMonitor). 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.SubMonitor)and then a client application has been started 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). 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.ProgressMonitorDialogwith fork mode enabled.- Parameters:
application- the application to stop, cannot benullcontext- the execution context, cannot benullmonitor- the progress monitor to report progress to, cannot benull- Throws:
ApplicationException- if method call failed with some reason
-
stop
@Deprecated(forRemoval=true) default ExecutionContext stop(IApplication application, ExecutionContext context, org.eclipse.core.runtime.SubMonitor monitor) throws ApplicationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
ApplicationException
-
delete
Deletes the specified application.- Parameters:
application- Application to be deleted. Must not benull.unsynchronize-trueif synchronization state is to be deleted orfalseis to keep synchronization state.- Throws:
ApplicationException- If the specified application could not be deleted for whatever reason.
-
onStateChanged
Called when application state has been changed.- Parameters:
application- Application whose state has changed. Nevernull.state- State in which application has been transitioned. Nevernull.
-
prepare(IApplication,String,ExecutionContext,SubMonitor)instead