此内容没有您所选择的语言版本。

10.2.5. JBoss Transaction Service Method Reference


The JBoss Transaction Service class StateManager manages the state of objects and provides all of the basic support mechanisms required for recovery, persistence, or both. Some operations must be defined by you. These operations are: save_state, restore_state, and type.
boolean save_state(OutputObjectState state, int ObjectType)
Invoked to save the state of an object for future use, for recovery or persistence. The ObjectType parameter indicates the reason for invocation. This allows you to save different pieces of information into the OutputObjectState supplied as the first parameter, depending on whether recovery or persistence is desired. For example, pointers to other JBoss Transaction Service objects may be saved as pointers for recovery, but as UIDs for persistence. The OutputObjectState class provides convenient operations, so that you can save instances of all of the basic types in Java. To support crash recovery for persistent objects all save_state methods need to call super.save_state.

Note

The save_state method assumes that an object is internally consistent and that all variables saved have valid values. Write and test your code to be sure this is true.
boolean restore_state(InputObjectState state, int ObjectType)
Restores an object to the specified state. The second parameter allows different interpretations of the supplied state. To support crash recovery for persistent objects all restore_state methods need to call super.restore_state.
String type ()
The JBoss Transaction Service persistence mechanism needs a way to determine the type of an object as a string, so that it can save and restore the state of the object. By convention, the position of the class in the hierarchy is used. For example, StateManager/LockManager/Object.

Note

The type method determines the location of the state of instances of a specified class are saved into the object store. This can actually be any valid string. However, avoid using the hash character #, which is reserved for special directories required by JBoss Transaction Service.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat