Class AbstractApplicationClientDelegate
java.lang.Object
com.e1c.g5.dt.applications.ui.contributors.AbstractApplicationClientDelegate
- All Implemented Interfaces:
IApplicationClientDelegate
- Direct Known Subclasses:
InfobaseApplicationClientDelegate,ServerApplicationClientDelegate
public abstract class AbstractApplicationClientDelegate
extends Object
implements IApplicationClientDelegate
Abstract implementation of
IApplicationClientDelegate provides common logic
for running a 1C:Enterprise runtime platform client by IApplication-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetClientType(ExecutionContext context) Gets 1C:Enterprise client type fromExecutionContextgetLaunchUrl(ExecutionContext context) Gets the launch (open) URL from execution contextprotected RuntimeExecutionArgumentsgetRuntimeExecutionArguments(ExecutionContext context, InfobaseReference infobase) Gets 1C:Enterprise runtime client launch arguments by current execution context and infobaselaunchUrlClient(IResolvableRuntimeInstallation installation, URL url, String clientType, RuntimeExecutionArguments arguments) Launches (opens) the provided URL as 1C:Enterprise runtime client. 1C:Enterprise runtime client component can be used if executor implementation needs component for execution.open(IResolvableRuntimeInstallation resolvableInstallation, InfobaseReference infobase, ExecutionContext context) Runs a 1C:Enterprise runtime platform client on the given infobase using the provided 1C:Enterprise runtime installation wrapper, that can be resolved to the real installation at any time.protected final booleansupportsPlatform(IApplication application) Checks thatIApplicationprovides special attribute with namePLATFORM_ATTRIBUTEand valuePLATFORM_V8Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.g5.dt.applications.contributors.IApplicationClientDelegate
open, supports
-
Constructor Details
-
AbstractApplicationClientDelegate
public AbstractApplicationClientDelegate()
-
-
Method Details
-
supportsPlatform
Checks thatIApplicationprovides special attribute with namePLATFORM_ATTRIBUTEand valuePLATFORM_V8- Parameters:
application- checking application, cannot benull- Returns:
trueif special attributePLATFORM_ATTRIBUTEwith correct valuePLATFORM_V8found in application,falseotherwise
-
getClientType
Gets 1C:Enterprise client type fromExecutionContext- Parameters:
context- to get client type from, cannot benull- Returns:
- 1C:Enterprise client type from
ExecutionContext, nevernull - Throws:
ApplicationException- if there is noIApplication.CONTEXT_CLIENT_TYPEproperty inExecutionContext
-
getLaunchUrl
Gets the launch (open) URL from execution context- Parameters:
context- to get client type from, cannot benull- Returns:
- the launch (open) URL from execution context, never
null, but may be empty if url was not stored inExecutionContext
-
open
protected Optional<Process> open(IResolvableRuntimeInstallation resolvableInstallation, InfobaseReference infobase, ExecutionContext context) throws RuntimeExecutionException, ApplicationException Runs a 1C:Enterprise runtime platform client on the given infobase using the provided 1C:Enterprise runtime installation wrapper, that can be resolved to the real installation at any time. Returns the started process.- Parameters:
resolvableInstallation- actual 1C:Enterprise runtime installation for gettingILaunchableRuntimeComponent, cannot benullinfobase-InfobaseReferencefor getting access settings and getting correctRuntimeInstallation, cannot benullcontext- to get client type from, cannot benull- Returns:
- a process handle of launched 1C:Enterprise client, never
null - Throws:
ApplicationException- if 1C:Enterprise runtime platform client cannot be runningRuntimeExecutionException
-
getRuntimeExecutionArguments
protected RuntimeExecutionArguments getRuntimeExecutionArguments(ExecutionContext context, InfobaseReference infobase) throws ApplicationException Gets 1C:Enterprise runtime client launch arguments by current execution context and infobase- Parameters:
context- to get client type from, cannot benullinfobase-InfobaseReferencefor getting access settings, if it isnulldefaultRuntimeExecutionArgumentswill be created- Returns:
- 1C:Enterprise runtime client launch arguments by current execution context and infobase, never
null - Throws:
ApplicationException- if error was occurred while getting access setting from infobase
-
launchUrlClient
protected Optional<Process> launchUrlClient(IResolvableRuntimeInstallation installation, URL url, String clientType, RuntimeExecutionArguments arguments) throws ApplicationException Launches (opens) the provided URL as 1C:Enterprise runtime client. 1C:Enterprise runtime client component can be used if executor implementation needs component for execution. Returns the started process or none if started process cannot be obtained (e.g. browser opening).- Parameters:
installation- actual 1C:Enterprise runtime installation for gettingILaunchableRuntimeComponent, cannot benullurl- the web URL to launch client with, cannot benullclientType- components identifiers, cannot benullarguments- the execution arguments, can benull, then will not be used- Returns:
- the optional handle of the started process or none if started process cannot be obtained (e.g. browser opening)
- Throws:
ApplicationException- if 1C:Enterprise runtime process execution fails
-