Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

29.3. Annotations for component lifecycle methods


These annotations allow a component to react to its own lifecycle events. They occur on methods of the component. Only one of these annotations may be used in any one component class.
@Create
@Create
Copy to Clipboard Toggle word wrap
Specifies that the method should be called when an instance of the component is instantiated by Seam. Create methods are only supported for JavaBeans and stateful session beans.
@Destroy
@Destroy
Copy to Clipboard Toggle word wrap
Specifies that the method should be called when the context ends and its context variables are destroyed. Destroy methods are only supported for JavaBeans and stateful session beans.
Destroy methods should be used only for cleanup. Seam catches, logs and swallows any exception that propagates out of a destroy method.
@Observer
@Observer("somethingChanged")
Copy to Clipboard Toggle word wrap
Specifies that the method should be called when a component-driven event of the specified type occurs.
@Observer(value="somethingChanged",create=false)
Copy to Clipboard Toggle word wrap
Specifies that the method should be called when an event of the specified type occurs, but that an instance should not be created if it does not already exist. If an instance does not exist and create is set to false, the event will not be observed. The default value is true.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat