4 Replies Latest reply on Dec 22, 2009 12:31 PM by rareddy

    Can attchement be accessed on ManagedComponent?

    rareddy

      Hi,

       

      After you get access to a ManagedComponent using profile service (in the same VM) can you access attachment object that is attached to the MC originally at creation time?

       

      If not, is there a way access the ManagedComponents in the same local VM, with out using Profile Service?

       

      What I am trying to do is, I have Managed Object "Foo" which deployed in the Container, for adminitstrative purposes I need to retrive this object or build a clone of this object based on the MC. Copying one property at time from MC to Foo seems verbose. I am trying see if I can build reverse of "initManagedObject" method on MOF interface.

       

      Can anyone suggest any better way to this?

       

      Thanks

       

      Ramesh..

        • 1. Re: Can attchement be accessed on ManagedComponent?
          emuckenhuber

          rareddy wrote:

           

          What I am trying to do is, I have Managed Object "Foo" which deployed in the Container, for adminitstrative purposes I need to retrive this object or build a clone of this object based on the MC. Copying one property at time from MC to Foo seems verbose. I am trying see if I can build reverse of "initManagedObject" method on MOF interface.

           

          It's actually the other way around you deploy a 'component' in a container e.g. a MC Bean. The management annotations just define how the management view for your component should look like. Where ProfileService is taking care of the mapping between the management view and the attachment (the deployment meta data).

          In general this management view should be fully based on the actual attachments in the deployers, where for MC beans we added a way to override this view with the actual bean.

           

          I'm not really sure if i fully understood what you are trying to do. So it would be good if you can explain a bit more. Most probably you don't even need to have access to the attachment as well. You can also point me to some code in the svn repo and i'll take a look.

          1 of 1 people found this helpful
          • 2. Re: Can attchement be accessed on ManagedComponent?
            rareddy

            Thank you for the explanation.

            emuckenhuber wrote:

            In general this management view should be fully based on the actual attachments in the deployers, where for MC beans we added a way to override this view with the actual bean.

              From a MC bean's management view, I am trying to either construct/clone or access the actual bean.

            emuckenhuber wrote:

            I'm not really sure if i fully understood what you are trying to do. So it would be good if you can explain a bit more. Most probably you don't even need to have access to the attachment as well. You can also point me to some code in the svn repo and i'll take a look.

            Sorry, I do not have any code on this yet. In Teiid, we deploy an artifact called VDB. This bean exposes management view with which admin tools like JOPR can identify manage these beans. At the same time Teiid also supports a 'admin' API where a user can access these beans for management, however this API is based on actual bean interface (mostly pojos) than management view interface.  To implement this admin interface layer, I am trying to build the actual beans from the management view layer. Obviously, I can hand pick each property from management view bean and build the actual bean for my purposes, I am looking for a easier way to auto build if one exists. I thought If  I could get access to actual bean I can easily solve this issue.

             

            Thank you.

            • 3. Re: Can attchement be accessed on ManagedComponent?
              emuckenhuber

              rareddy wrote:


              Sorry, I do not have any code on this yet. In Teiid, we deploy an artifact called VDB. This bean exposes management view with which admin tools like JOPR can identify manage these beans. At the same time Teiid also supports a 'admin' API where a user can access these beans for management, however this API is based on actual bean interface (mostly pojos) than management view interface.  To implement this admin interface layer, I am trying to build the actual beans from the management view layer. Obviously, I can hand pick each property from management view bean and build the actual bean for my purposes, I am looking for a easier way to auto build if one exists. I thought If  I could get access to actual bean I can easily solve this issue.

               

              Hmm ok, looking a bit through the teiid API i found somthing called ConfigurationAdmin. Are you referring to something like this?

               

              In general this sounds like a separate issue than the 'usual' ProfileService integration - more related to DeploymentTemplates? Basically you should have access to the attachment using the ManagedObject interface. For this you might not need a ManagedComponent, since the hirarchy is not built in the MOF.

               

              Changes to a ManagedObject should get written back to the attachment by default e.g. your VDB deployment meta data. So you might need to register a InstaceClassFactory handling your attachment type if there is additional logic needed to handle the attachment and you should be able to use this directly.

              1 of 1 people found this helpful
              • 4. Re: Can attchement be accessed on ManagedComponent?
                rareddy

                emuckenhuber wrote:

                Hmm ok, looking a bit through the teiid API i found somthing called ConfigurationAdmin. Are you referring to something like this?

                Yes, This is one of the interfaces I am trying to implement.

                 

                After looking at the ManagedObject WIKI page again, I saw the "MetaMapper" class. I was looking for something like that. Where the 'unwrapMetaValue' call builds a copy of target Object from MetaValue object.  I could use "DefaultMetaValueFactory" and call the 'unwrap' to get the instance of the object. Currently these are 'readOnly' so this should suffice.

                 

                Originally I thought unwarp process may be some how automated, but after giving little more thought that did not make sense to myself.

                 

                Thanks.