2 Replies Latest reply on Jan 12, 2009 1:25 PM by Trustin Lee

    Hiding a bean from the rest of the world

    David Lloyd Master

      I'd like to set up my BeanMetaData so that I can deploy a bean as a part of another deployment without it being visible to other deployments.

      The use case in this case is that I want the publicly available bean to implement a public interface. The public bean delegates to the *real* bean instance, which has (among other things) the (public) lifecycle methods on it. This way the user can't "get at" the lifecycle methods or any internal state that I don't want to be visible. But unless the private bean is invisible or unavailable to other deployments, then having two separate objects is pointless.

      The user would treat the public bean as the object of interest which they could inject or use however they like. But the private bean is the one with the lifecycle methods.

      How can I hide the private bean?