org.opengroup.arm40.transaction.ArmApplication Interface Reference
[ARM 4.0 Applications]
Represents an instance of an executing application. More...

Public Member Functions | |
int | end () |
indicates that the application instance has halted. | |
String | getContextValue (int index) |
retrieves a context property value. | |
ArmApplicationDefinition | getDefinition () |
String | getGroup () |
String | getInstance () |
Detailed Description
Represents an instance of an executing application.
It provides an anchor point for associating ArmTransaction 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 ArmApplicationDefinition 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
ArmApplication
andArmTransaction
have context values that may be unique for each application and transaction instance, respectively. However, the mechanisms for setting the context values are different. InArmApplication
, they are set in the factory method and are immutable afterwards. InArmTransaction
, they are set at any time and processed each time astart()
executes.The reason for the difference is that
ArmApplication
objects are not reused. One object is created per application instance. If another instance starts, a newArmApplication
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 theArmApplication
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
ArmTransaction
object for each transaction instance, and then garbage collecting it afterwards, would result in unacceptable and unnecessary overhead. Instead, anArmTransaction
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 ArmApplication
object, it may not use any reference to the ArmApplication
object, nor may it call any method of any object created using a reference to the ArmApplication
object (e.g., creating an instance of ArmTransaction
using the newArmTransaction()
method of ArmTransactionFactory
). Any transactions that are currently in-process [start()
executed but stop()
not executed] will be discarded by implicitly executing the ArmTransaction 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 ArmTransactionFactory#newArmApplication.
Member Function Documentation
int org.opengroup.arm40.transaction.ArmApplication.end | ( | ) |
indicates that the application instance has halted.
See comments in the interface description above.
- Returns:
- 0 on sucess; otherwise, a non-zero error code is returned (as specified in org.opengroup.arm40.transaction.ArmInterface).
String org.opengroup.arm40.transaction.ArmApplication.getContextValue | ( | int | index | ) |
retrieves a context property value.
- 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.
ArmApplicationDefinition org.opengroup.arm40.transaction.ArmApplication.getDefinition | ( | ) |
- Returns:
- the metadata describing this application.
String org.opengroup.arm40.transaction.ArmApplication.getGroup | ( | ) |
- Returns:
- the group name this application is associated with, or
null
. See comments in the interface description above.
String org.opengroup.arm40.transaction.ArmApplication.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:
- org/opengroup/arm40/transaction/ArmApplication.java