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

10.3.4. Object construction and destruction


JBoss Transaction Service objects can be either recoverable, persistent, both, or neither. Also, each object has a unique internal name. These attributes can only be set when that object is constructed. Therefore, LockManager provides two protected constructors for use by derived classes, each of which fulfils a distinct purpose:
LockManager ()
Allows the creation of new objects, which have no prior state.
LockManager(int ObjectType, ObjectName attr)
Allows the creation of new objects, which have no prior state. The ObjectType parameter denotes whether an object is recoverable, recoverable and persistent (indicated by ANDPERSISTENT) or neither (NEITHER). If an object is marked as being persistent, its state is stored in one of the object stores. The shared parameter only has meaning if the object is RECOVERABLE.; If attr is not null and the object model is SINGLE (the default behavior), then the recoverable state of the object is maintained within the object itself. Otherwise, the state of the object is stored in an in-memory object store between atomic actions.
Constructors for new persistent objects should make use of atomic actions within themselves. This will ensure that the state of the object is automatically written to the object store either when the action in the constructor commits, or, if an enclosing action exists, when the appropriate top-level action commits.
LockManager(Uid objUid)
Allows access to the existing persistent object named in the objUid parameter. The object's prior state, which is identified by the value of the objUid parameter), is loaded from an object store automatically.
LockManager(Uid objUid, ObjectName attr)
Allows access to the existing persistent object named in the objUid parameter. The object's prior state, which is identified by the value of the objUid, is loaded from an object store automatically. If the attr parameter is not null, and the object model is SINGLE (the default behaviour), then the object is not reactivated at the start of each top-level transaction.
The destructor of a programmer-defined class needs to invoke the inherited operation terminate, to inform the state management mechanism that the object is about to be destroyed. Otherwise, unpredictable results may occur.
Because the LockManager class inherits from StateManager, it passes any supplied ObjectName instances to the StateManager class. As such, you can set the StateManager object model as described earlier.
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