Was spielt die Rolle in Frühlingsbohnen?Java

Java-Forum
Anonymous
 Was spielt die Rolle in Frühlingsbohnen?

Post by Anonymous »

Ich lerne etwas über Frühlingsbohnen. Ich habe in BeanDefinition festgestellt, dass wir mit @role Bean eine Rolle hinzufügen können. Aber ich verstehe nicht, wann ich die Rolle anwenden soll. Ich meine, was sind Auswirkungen dieser Annotation? Wann und wie Menschen diese Annotation nutzen? Ich habe die Dokumente gelesen, konnte aber nicht richtig verstehen < /p>

Code: Select all

/**
* Role hint indicating that a {@code BeanDefinition} is a major part
* of the application. Typically corresponds to a user-defined bean.
*/
int ROLE_APPLICATION = 0;

/**
* Role hint indicating that a {@code BeanDefinition} is a supporting
* part of some larger configuration, typically an outer
* {@link org.springframework.beans.factory.parsing.ComponentDefinition}.
* {@code SUPPORT} beans are considered important enough to be aware
* of when looking more closely at a particular
* {@link org.springframework.beans.factory.parsing.ComponentDefinition},
* but not when looking at the overall configuration of an application.
*/
int ROLE_SUPPORT = 1;

/**
* Role hint indicating that a {@code BeanDefinition} is providing an
* entirely background role and has no relevance to the end-user. This hint is
* used when registering beans that are completely part of the internal workings
* of a {@link org.springframework.beans.factory.parsing.ComponentDefinition}.
*/
int ROLE_INFRASTRUCTURE = 2;

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post