OpenGroup::arm40::Provisional::transaction::IArmApplication Interface Reference
[ARM 4.0 Applications]
ArmApplication represents an instance of an executing application. More...
Public Member Functions | |
IArmApplicationDefinition | getDefinition () |
returns the metadata describing this application. | |
string | getGroup () |
returns the group name this application is associated. | |
string | getInstance () |
returns the instance name attributed to this application. | |
int | end () |
indicates that the application instance has halted. | |
string | getContextValue (int index) |
retrieves a context property value. |
Detailed Description
It provides an anchor point for associating ArmTransaction objects with the application instance. Instances of ArmApplication are created using the newArmApplication() method of ArmTransactionFactory.
It provides an anchor point for associating IArmTransaction objects with the application instance. It has the following attributes, all of which are immutable:
-
Application definition. The metadata common to all instances of this application. The value must not be
null
. -
Group (optional). A group is a set of application instances that are treated as a group for some aspects of management, such as workload balancing (work could be routed to any instance of the group). The maximum length is 255 characters. The value may be
null
. A non-null
value should not contain trailing blank characters or consist of only blank characters. -
Instance (optional). The instance could be used to distinguish between instances of the same application. ARM does not require that this field be used or that it be unique, though its use is suggested. The maximum length is 255 characters. The value may be
null
. A non-null
value should not contain trailing blank characters or consist of only blank characters. -
Context values (optional). The "value" part of (name,value) properties that may vary per application instance. The "name" part is available via
GetDefinition().GetIdentityProperties().GetContextName()
. The values are position-sensitive they match the position in the referenced context name array. The context property name at the specified array index must have been set to a non-null
value when the IArmApplicationDefinition object was created. If the name isnull
or a zero-length string, both the name and value are ignored. If the value isnull
or a zero-length string, the meaning is that there is no value for this instance. Names should not contain trailing blank characters or consist of only blank characters.Note that both
IArmApplication
andIArmTransaction
have context values that may be unique for each application and transaction instance, respectively. However, the mechanisms for setting the context values are different. InIArmApplication
, they are set in the factory method and are immutable afterwards. InIArmTransaction
, they are set at any time and processed each time astart()
executes.The reason for the difference is that
IArmApplication
objects are not reused. One object is created per application instance. If another instance starts, a newIArmApplication
is created. This is a reasonable design pattern because applications are long-lived. In most cases, once an application starts, it continues to execute for a long time, so the cost of creating theIArmApplication
object and then garbage collecting it is not significant.Transactions, on the other hand, are often very short-lived, with response times that are often measured in milliseconds. Creating a new
IArmTransaction
object for each transaction instance, and then garbage collecting it afterwards, would result in unacceptable and unnecessary overhead. Instead, anIArmTransaction
object is created and then reused over and over. Each executing transaction is represented by the pairedstart()
/stop()
methods. For this reason, context values are set using setter methods.
end()
indicates that the application instance has halted. After end()
executes, the application instance may not call any other method of the IArmApplication
object, it may not use any reference to the IArmApplication
object, nor may it call any method of any object created using a reference to the IArmApplication
object (e.g., creating an instance of IArmTransaction
using the newArmTransaction()
method of IArmTransactionFactory
). Any transactions that are currently in-process [start()
executed but stop()
not executed] will be discarded by implicitly executing the IArmTransaction reset()
method. The ARM implementation should protect itself against a poorly behaved application that does not respect the specification.
Objects implementing this interface are created using IArmTransactionFactory.newArmApplication
Member Function Documentation
int OpenGroup::arm40::Provisional::transaction::IArmApplication::end | ( | ) |
See comments in the interface description above.
- Returns:
- 0 on sucess; otherwise, a non-zero error code is returned (as specified in OpenGroup.arm40.Provisional.transaction.IArmInterface
string OpenGroup::arm40::Provisional::transaction::IArmApplication::getContextValue | ( | int | index | ) |
- Parameters:
-
index the index into the context properties array.
- Returns:
- The context value at the specified index, or
null
. See comments in the interface description above.
IArmApplicationDefinition OpenGroup::arm40::Provisional::transaction::IArmApplication::getDefinition | ( | ) |
- Returns:
- the metadata describing this application.
string OpenGroup::arm40::Provisional::transaction::IArmApplication::getGroup | ( | ) |
- Returns:
- the group name this application is associated with, or
null
. See comments in the interface description above.
string OpenGroup::arm40::Provisional::transaction::IArmApplication::getInstance | ( | ) |
- Returns:
- the instance name attributed to this application, or
null
. See comments in the interface description above.
The documentation for this interface was generated from the following file:
- opengroup/arm40/provisional/transaction/IArmApplication.cs