Skip to content

Been Object Model

sixtam edited this page Dec 5, 2012 · 1 revision

JAXB

Task Descriptor

Purpose: Description of a task

Example:

<?xml version="1.0"?>
<taskDescriptor xmlns="http://been.mff.cuni.cz/taskmanager/td"
                taskId="clinterface-tid" contextId="system"
                treeAddress="/legacy/clinterface" name="clinterface" >
  <package>
    <name>clinterface-1.0.bpk</name>
  </package>

  <hostRuntimes>
    <name>localhost</name>
  </hostRuntimes>

  <dependencies>
	<dependencyCheckPoint taskId="softwarerepository-tid" type="service status" value="running"/>
  </dependencies>
</taskDescriptor>

Detailed description:

The XSD (td.xsd) is represented in Java by cz.cuni.mff.been.jaxb.td.TaskDescriptor class.

The root element is taskDescriptor, attributes

  • taskId:
  • the attribute is required
  • contextId: Context of the task.
  • the attribute is required
  • treeAddress: Address of the task.
  • the attribute is required
  • name: Name of the task?
  • description: Description of the task.
  • exclusive: How the task can be run in regard to other tasks on the same hostruntime.
  • non-exclusive: Can be run with other tasks.
  • context-exclusive: Can be run with other tasks from the same context.
  • exclusive: Only this task can be run on chosen runtime.

Subelements:

  • longDescription:
  • arguments: List of arguments for a task.
     <arguments>
       <argument>first</argument>
       <argument>second</argument>
     </arguments>
  • java: Properties for the JVM which run the task.
  • Currently there are no other options other then javaOptions
<java>
  <javaOptions>
    <javaOption>-Xea</javaOption>
    <javaOption>-Dkey=value</javaOption>
  </javaOptions>
</java>
  • taskProperties: Properties of a task
<taskProperties>
  <taskProperty>
    <key>my.key</key>
    <value>MyValue</value>
  </taskProperty>
</taskProperties>
  • keys and values are strings

  • key is required

  • a task can obtain these properties via package cz.cuni.mff.been.task.Task.{getProperties, getProperty}

  • taskPropertyObjects: similar to taskProperties, but can store "larger objects", in string or in binary format

<taskPropertyObjects>
  <taskPropertyObject>
    <key>key1</key>
    <strval> ... </strval>
  </taskPropertyObject>

  <taskPropertyObject>
    <key>key2</key>
    <binval>  </binval>
  </taskPropertyObject>

<taskPropertyObjects>
  • strval is represented as cz.cuni.mff.been.jaxb.td.StrVal, XML encoded object
  • binval is represented as byte[], Base64 encoded Object
  • see cz.cuni.mff.been.common.serialize.* for utility functions
  • package: package which to use to run the task
<package>
  <name>NameOfThePackage</name>
</package>
<package>
  <rsl>RslOfThePackage</rsl>
</package>
  • can be specified either as a name of a package or as RSL

  • this element is required

  • hostRuntimes

<xs:complexType name="HostRuntimes">
  <xs:sequence>	<!-- Temporary hack. <asTask> and <rsl> are exclusive. -->
    <xs:element ref="td:asTask" minOccurs="0" maxOccurs="1"/>
    <xs:element ref="td:rsl" minOccurs="0" maxOccurs="1"/>
    <xs:element ref="td:name" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
  • asTask: on the same hostruntime as other task>
  • you can specify more than one runtime by name (== hostname)
  • dependencies
<dependencies>
  <dependencyCheckPoint taskId="some-tid" type="service status" value="running"/>
  <dependencyCheckPoint taskId="otjer-tid" type="service status" value="running"/>
</dependencies>
  • TODO you can wait for specific value ..
  • failurePolicy
<failurePolicy restartMax="0" timeoutRun="0"/>
  • restartMax: maximum restarts after a task failure

  • timeoutRun: 0 not restricted, otherwise maximum running time in seconds

  • loadMonitoring

<xs:attributeGroup name="loadMonitoringAttrGroup">
  <xs:attribute name="detailedLoad" type="xs:boolean" use="optional" default="false"/>

  <!-- 0 == use default. -->
  <xs:attribute name="detailedLoadInterval" type="common:nonnegativeLong" use="optional" default="0"/>
  
  <xs:attribute name="loadUnits" type="common:nonnegativeInt" use="optional" default="128"/>
</xs:attributeGroup>
	
<xs:complexType name="LoadMonitoring">
  <xs:attributeGroup ref="td:loadMonitoringAttrGroup"/>
</xs:complexType>
  • detailedLoad: whether to gather detailed load statistics
  • detailedLoadInterval: TODO explain
  • loadUnits: TODO explain

Clone this wiki locally