Este conteúdo não está disponível no idioma selecionado.

12.2. Direct Use of the StateManager Class


The examples throughout this manual derive user classes from the LockManager class. There are two reasons for this.
  • Most importantly, the serializability constraints of atomic actions require it.
  • It reduces the need for programmer intervention.
However, if you only require access to the persistence and recovery mechanisms of JBoss Transaction Service, you can directly derive a user class from StateManager.
Classes derived directly from StateManager must make use of its state management mechanisms explicitly, rather than relying on LockManager. You need to make appropriate use of the activate, deactivate, and modified methods, since the constructors of StateManager are effectively identical to those of LockManager.

12.2.1. The activate Method

boolean activate ()
boolean activate (String storeRoot)
Copy to Clipboard Toggle word wrap
The activate method loads an object from the object store. The object’s UID needs to already be set via the constructor, and the object must exist in the store. If the object is successfully read, the restore_state method is called to build the object in memory. The activate method operates such that once an object has been activated, further calls are ignored. The parameter represents the root name of the object store to search for the object. If the value is null, the default store is used.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat