Interface IRuntime


  • public interface IRuntime
    Describes a specific type of 1C:Enterprise platform runtime. 1C:Enterprise runtimes are defined by extensions. 1C:Enterprise runtime extension is defined in plugin.xml.

    Following is an example definition of an 1C:Enterprise runtime extension:

     <extension point="com._1c.g5.v8.dt.platform.runtimes">
        <runtime
           id="com._1c.g5.v8.dt.platform.runtime.8.3.10"
           version="8.3.10"
           name="1C:Enterprise 8.3.10">
        </runtime>
     </extension>
     

    Defined 1C:Enterprise runtimes can be used in 1C:Enterprise version-dependent services or extensions. Clients may use IRuntimeRegistry to get all registered runtimes or a specific runtime.

    Developing version-dependent Extension Points

    Clients may use registered runtimes to allow to register their own extensions with a reference to some registered runtime extension. So clients may define some logic with an extension defined for specific version of 1C:Enterprise runtime and control that this specific runtime version is registered and supported by IDE. Clients may use predefined runtime compatibility extension expressions. To use it in their own Extension Point defition they need to include schema runtimeCompatibility:

     <include schemaLocation="schema://com._1c.g5.v8.dt.platform/schema/runtimeCompatibility.exsd"/>
    
     ...
    
     <element name="delegate">
        <complexType>
           <sequence minOccurs="1" maxOccurs="unbounded">
              <element ref="runtime"/> <!-- it is reference to runtimeCompatibility.exsd -->
           </sequence>
           <attribute name="id" type="string" use="required">
           <attribute name="class" type="string" use="required">
        </complexType>
     </element>
     

    Clients may later easily compute all defined versions for all registered extensions in their extension registry using RuntimeCompatibility support class:

     List<Version> versions = new ArrayList<>();
     IConfigurationElement[] runtimes = configurationElement.getChildren("runtime");
     for (IConfigurationElement childElement : runtimes)
     {
         versions.addAll(RuntimeCompatibility.computeVersions(childElement));
     }
     

    For the provided above Extension Point following is an example definition of an 1C:Enterprise version-specific service extension with a dependecy to registered runtime versions:

     <extension point="com._1c.g5.v8.dt.platform.specificVersionClassDelegate">
        <!-- this class will be contributed only for runtime version 8.3.10 -->
        <delegate
              class="com._1c.g5.v8.dt.platform.SpecificVersionClassDelegate_v8_3_10"
              id="com._1c.g5.v8.dt.platform.specificVersionService.delegate.8.3.10">
           <runtime>
              <equal="com._1c.g5.v8.dt.platform.runtime.8.3.10"/>
           <runtime/>
        </delegate>
        <!-- this class will be contributed for runtime versions 8.3.11 and above-->
        <delegate
              class="com._1c.g5.v8.dt.platform.SpecificVersionClassDelegate_v8_3_11"
              id="com._1c.g5.v8.dt.platform.specificVersionService.delegate.8.3.11">
           <runtime>
              <since="com._1c.g5.v8.dt.platform.runtime.8.3.11"/>
           <runtime/>
        </delegate>
     </extension>
     
    See Also:
    RuntimeCompatibility, Version
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • getId

        String getId()
        Returns this 1C:Enterprise runtime identifier. This corresponds to the id attribute specified in the extension definition.
        Returns:
        the 1C:Enterprise platform runtime identifier, never null
      • getVersion

        Version getVersion()
        Returns this 1C:Enterprise runtime version. This corresponds to the version attribute specified in the extension definition, parsed into Version.
        Returns:
        the 1C:Enterprise platform runtime version, never null
      • getName

        String getName()
        Returns this 1C:Enterprise runtime name (text presentation). This corresponds to the name attribute specified in the extension definition.
        Returns:
        the 1C:Enterprise platform runtime name, never null