Skip to content

Allow to define bean metadata in spring context [SPR-1711] #6408

Closed

Description

@spring-projects-issues

Eugene Kuleshov opened SPR-1711 and commented

It would be convenient to be able to define metadata for beans configured and managed by Spring. Such metadata can be used by bean post processor and AOP interceptors when code-level metadata can't be used.

Possible config could look something like this:

<bean id=""... >
<ann class="Async"/>
<ann class="Remote">
<property name="name1" value="something"/>
<property name="name2"><value><ann class="..."/></value></property>
</ann>
...
</bean>

Annotations could be available trough new method on BeanFactory and can be implemented using dynamic proxy that created on annotation interfaces.


Attachments:

Activity

  1. spring-projects-issues commented on Feb 28, 2006

    @spring-projects-issues
    CollaboratorAuthor

    Eugene Kuleshov commented

    This would also allow to handle #6343

  2. spring-projects-issues commented on May 26, 2006

    @spring-projects-issues
    CollaboratorAuthor

    Eugene Kuleshov commented

    Implementation of the custom namespace handler that allows to declare maps and lists. For example:

    <beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:meta="http://www.springframework.org/schema/meta"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/meta
    http://www.springframework.org/schema/meta/spring-meta.xsd">

    <bean id="foo">
    <meta:list name="testList">
    <meta:value>value1</meta:value>
    <meta:value>value2</meta:value>
    <meta:value>
    value31
    value32
    </meta:value>
    </meta:list>

    <meta:map name="testMap">
      <meta:entry key="key1">value1</meta:entry>
      <meta:entry key="key2">value2</meta:entry>
    </meta:map>
    

    </bean>
    </beans>

  3. spring-projects-issues commented on May 31, 2006

    @spring-projects-issues
    CollaboratorAuthor

    Colin Sampaleanu commented

    This is useful.

    The only question to me is if this is something so basic it should be handled by the normal parser, similar to the regular meta tag. I would almost argue for the latter. In talking to Rob about this he's also in agreement that this should probably just be built-in...

    Given how close we are to 2.0, this is unfortunately not in scope

  4. spring-projects-issues commented on May 31, 2006

    @spring-projects-issues
    CollaboratorAuthor

    Eugene Kuleshov commented

    Colin, Rob, if you can define a DTD for default parser that wwould allow similar functionality I can work on impementation and test cases for this. I really need it to happend for 2.0...

  5. spring-projects-issues commented on Dec 12, 2011

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Out of date; likely invalidated by annotations anyway.

  6. added
    status: declined
    type: enhancement
    in: core
    on Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: declinedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions