4 Replies Latest reply on Dec 18, 2008 1:31 AM by alrubinger

    Define dependency for ValueMetaData?

    alrubinger

      I've got a ValueMetaData upon which I need to define a dependency before getValue() may be called.

      Possible? This is so that the target value is available before I inject via an annotation plugin.

      S,
      ALR

        • 1. Re: Define dependency for ValueMetaData?
          alesj

           

          "ALRubinger" wrote:

          Possible? This is so that the target value is available before I inject via an annotation plugin.

          Sure, we do it all the time.
          Check AbstractDependencyValueMetaData on how it's done.

          • 2. Re: Define dependency for ValueMetaData?
            alrubinger

            Nice.

            public class AbstractEjbReferenceValueMetadata extends AbstractDependencyValueMetaData


            ...and...

            /**
             * Used in defining the dependency
             */
             @Override
             public Object getUnderlyingValue()
             {
             return DEPENDS_JNDI_PREFIX + this.getTargetJndiName();
             }


            ...gets the job done as it's picked up by initialVisit.

            Another follow-up. :)

            Is there an equivalent to my DEPENDS_JNDI_PREFIX (=="jndi:") so I don't have to define it myself?

            S,
            ALR

            • 3. Re: Define dependency for ValueMetaData?
              alesj

               

              "ALRubinger" wrote:
              Is there an equivalent to my DEPENDS_JNDI_PREFIX (=="jndi:") so I don't have to define it myself?

              Not to my knowledge.

              But/and why would we have something like this in MC?


              • 4. Re: Define dependency for ValueMetaData?
                alrubinger

                 

                "alesj" wrote:
                Why would we have something like this in MC?


                Isn't it MC which knows how to treat that the "jndi:" prefix defines a dependency upon a JNDI entry?

                Otherwise it's just some magic string?

                S,
                ALR