Este contenido no está disponible en el idioma seleccionado.

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.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat