Skip to content

expose bean identifiers #926

@Ladicek

Description

@Ladicek

All implementations (ArC, Weld, OWB) have a notion of bean identifier. The identifier is unique for all beans in the "current" deployment. In Weld, it seems it's unique across deployments as well. ArC doesn't support multiple concurrent deployments, so it's easy there. It is not unique across deployments in OWB, which feels fine, I don't think we need that. It's typically a String; in one case when it's not (Weld), there's a method to convert it to String, so that feels like a decent type. It feels useful to expose it through the standard API.

I see 2 concerns immediately:

  1. To not break previous custom implementations of Bean, the method should be default. However, there's really no good default value. It doesn't feel right to return null or throw an exception, and it doesn't feel right to make it non-default.
  2. There's an interface PassivationCapable that already exposes the getId() method. But this interface comes with extra contracts that are not defined by the prescribed methods. It doesn't feel right to let all beans implement PassivationCapable. We could possibly move the method to Bean and leave PassivationCapable as a marker interface, but the javadoc indicates that custom implementation of Contextual can also be PassivationCapable, so either we would have to move getId() to Contextul, or leave it in PassivationCapable as well.

Overall it feels like more trouble than what it's worth, but I'm interested in other opinions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions