1 2 Previous Next 27 Replies Latest reply on Feb 5, 2009 12:51 PM by starksm64 Go to original post
      • 15. Re: The DeploymentManager and ProfileService
        emuckenhuber

         

        "bstansberry@jboss.com" wrote:

        Semi-OT, but one think that makes it hard to discuss is the term "profile" is overloaded.

        Yes i also do think it's a bit overloaded - therefore i think a named group of deployments which belong together fits quite good :)

        "bstansberry@jboss.com" wrote:

        I still see those as two different although related things. Perhaps from the point of view of an SPI it doesn't matter. I'd think management tools would care though: can the tool add or remove content from this subprofile? Can the tool update existing content? Will the repository itself detect and allow content added or removed not via the management tool? Will the repository itself detect updates to existing content? This is all information that should be exposed.


        I think also the term sub-profile seems to need some more definition.
        Actually a sub-profile is just a profile - it is a notion which implies a relationship/dependency between two profiles.

        What you actually can do with the profile then depends on the implementation itself.

        "bstansberry@jboss.com" wrote:

        Yep, looking at Emmanuels XML examples last week...

        One "m" is enough - just Emanuel ;)

        • 16. Re: The DeploymentManager and ProfileService
          starksm64

           

          "emuckenhuber" wrote:

          "scott.stark@jboss.org" wrote:

          If we completely abstract out the deployment and admin content into a deployment repository, then I can see a differentiation between a dynamic profile that is one define by root urls against the deployment repository vs a profile that allows modifications to both deployment collection make up and content changes.


          One thing i don't like about the current implementation is that a profile is more defined over
          it's DeploymentRepository than it is defined by itself (the actual profile).

          Well i mean the implementation is not a big deal, just want to say that when talking about the definition of a Profile,
          a DeploymentRepository should be optional.

          On the other hand this is actually the main point of this thread. Basically how the DeploymentManager gets access
          to the low level source of a mutable profile.
          I'm not planning to change this yet - just an idea to think about :)


          I'm begining to think that there is no point to a Profile without a DeploymentRepository though. The reason is that at its most explicit a profile has a list of URLs/URIs that define the deployments in some VFS. However, even include the VFS protocol is an implicit repository notion that would more generally handled by the DeploymentRepository and the profile would be relative paths against the repository. More generally I'm working toward much more abstract profiles that have to be resolved against a repository. The repository still is an implementation detail as there is no need for it to be exposed from the profile, but the profile is also not useful without the repository.

          Your moving away from the Profile exposing deployments as VFSDeployment right? I don't see the ProfileDeployment in trunk, is it somewhere yet?


          • 17. Re: The DeploymentManager and ProfileService
            emuckenhuber

             

            "scott.stark@jboss.org" wrote:

            Your moving away from the Profile exposing deployments as VFSDeployment right? I don't see the ProfileDeployment in trunk, is it somewhere yet?


            I've committed the update to the spi, i'll see if i can commit the updates to trunk tomorrow - just want to run some tests first.

            • 18. Re: The DeploymentManager and ProfileService
              starksm64

              That's fine, I'll checkout the spi project and take a look until its in trunk.

              • 19. Re: The DeploymentManager and ProfileService
                emuckenhuber

                 

                "scott.stark@jboss.org" wrote:
                That's fine, I'll checkout the spi project and take a look until its in trunk.


                Okay i've updated trunk with the my current changes.

                "scott.stark@jboss.org" wrote:

                I'm begining to think that there is no point to a Profile without a DeploymentRepository though.The reason is that at its most explicit a profile has a list of URLs/URIs that define the deployments in some VFS.


                Hmm, there are some use cases where you don't need any repository.
                For example the transient application profile managed by the DeploymentManager.
                This will be just a hashMap containing the isCopyContent == false deployments, so that they
                are also visible in the ManagementView.
                But it's still a independent profile, which can be activated / deactivated by the DeploymentManager.

                Furthermore i think a VFS/uri does not make up a profile, as you still can could have a different (maybe static) profile,
                where you create non-vfs based deployments - this is now also possible with the abstraction of ProfileDeployment (although not fully implemented)

                Also if you look at FilteredDeploymentRepositoryFactory - this would not really be needed,
                as all the profile has to do is once to get it deployments.
                That's basically the reason why i think that a DeploymentRepository is optional.

                Even having an OBR based Profile, would not change much - as the profile implementation would map
                the deployments with the help of a OBR repository service.
                There could also be a requirement/capability resolving, but this should be similar to the RequirementDependencyItem
                from jboss-classloading, where you just get a dependency on a different profile instead of resources.
                [OT: that's why i was mentioning that i want to review getSubProfiles(), as this would might be better to have a
                ProfileVisitor where you can create your specific DependencyItems for your Profile.]

                Although i also think that there is something missing - but more in the sense of a ResourceDiscovery or ProfileSource.
                Something where you can share the same source and don't need to maintain the profile root uris in each profile.
                Maybe this also matches somehow to the work you want to do with a DeploymentRepository?

                Can you provide some more information and/or use cases why you think this is not enough?
                I mean maybe i'm just missing something :)


                • 20. Re: The DeploymentManager and ProfileService
                  starksm64

                   

                  "emuckenhuber" wrote:

                  Hmm, there are some use cases where you don't need any repository.
                  For example the transient application profile managed by the DeploymentManager.
                  This will be just a hashMap containing the isCopyContent == false deployments, so that they
                  are also visible in the ManagementView.
                  But it's still a independent profile, which can be activated / deactivated by the DeploymentManager.

                  Ok, so an issue with that is how do we store admin edits of such profiles?

                  "emuckenhuber" wrote:

                  Furthermore i think a VFS/uri does not make up a profile, as you still can could have a different (maybe static) profile,
                  where you create non-vfs based deployments - this is now also possible with the abstraction of ProfileDeployment (although not fully implemented)

                  Right, the profiles I'm working on don't have URIs either as they are described in terms of criteria that need to be resolved.

                  "emuckenhuber" wrote:

                  Although i also think that there is something missing - but more in the sense of a ResourceDiscovery or ProfileSource.
                  Something where you can share the same source and don't need to maintain the profile root uris in each profile.
                  Maybe this also matches somehow to the work you want to do with a DeploymentRepository?

                  Can you provide some more information and/or use cases why you think this is not enough?
                  I mean maybe i'm just missing something :)

                  What's missing is a generic ProfileBootstrap that can have different ways of specifying subprofiles that should be included. For example, the deployers and base services would be specified via criteria, user apps specified via a uri to one or more apps defined in a jboss tools project. I'm going to review the changes in trunk tonight, but it is probably more of a notion of a resolver that I'm thinking of.


                  • 21. Re: The DeploymentManager and ProfileService
                    emuckenhuber

                     

                    "scott.stark@jboss.org" wrote:

                    Ok, so an issue with that is how do we store admin edits of such profiles?


                    I think in this case the Profile itself would need to take care about it, because for a VFSDeployment we can check the metadata paths,
                    if there were modifications and don't apply admin edits. But we don't have a generic way to do that for a normal Deployment.

                    But in the end if we have something like (e.g. in the ManagementView)
                     removeAttachments(ProfileDeployment d, String attachmentName);
                    


                    this could also work.

                    "scott.stark@jboss.org" wrote:

                    What's missing is a generic ProfileBootstrap that can have different ways of specifying subprofiles that should be included. For example, the deployers and base services would be specified via criteria, user apps specified via a uri to one or more apps defined in a jboss tools project. I'm going to review the changes in trunk tonight, but it is probably more of a notion of a resolver that I'm thinking of.


                    Yes there is definitely some work to do on the ProfileServiceBootstrap. Especially the one based on xml
                    needs some more work, if you want to look at that one.

                    • 22. Re: The DeploymentManager and ProfileService
                      starksm64

                       

                      "emuckenhuber" wrote:

                      Yes there is definitely some work to do on the ProfileServiceBootstrap. Especially the one based on xml
                      needs some more work, if you want to look at that one.


                      I think that instead of the current ProfileServiceBootstrap usage of an injected AbstractBootstrapProfileFactory to build the current profile, what we need is a

                      public interface ProfileResolver
                      {
                       public Collection<Profile> createProfiles(ProfileKey rootKey, Server server, Properties props)
                       throws Exception;
                      
                      }
                      


                      and the current AbstractBootstrapProfileFactory could be ProfileResolvers. Maybe this could be a list/set of resolvers in the AbstractBootstrapProfileFactory so that its recursive logic still could be used to resolve both the profile and subprofiles across all of the resolvers. I'll work on this approach a bit.


                      • 23. Re: The DeploymentManager and ProfileService
                        emuckenhuber

                         

                        "scott.stark@jboss.org" wrote:
                        Maybe this could be a list/set of resolvers in the AbstractBootstrapProfileFactory so that its recursive logic still could be used to resolve both the profile and subprofiles across all of the resolvers. I'll work on this approach a bit.


                        Hmm okay - but there is also a ProfileFactory, so the resolver should either just resolve the ProfileMetaData
                        or use the ProfileFactory then - whereas there could also be more ProfileFactories, one for each profile meta data type.

                        Furthermore the AbstractBootstrapProfileFactory should actually do more than it's doing now.

                        There are some weird implicit dependencies set, to ensure the correct ordering during the bootstrap.
                        We might want to change this behavior, that the AbstractBootstrapProfileFactory also registers and activates
                        the Profiles based on the ordering in the xml and just keep explicit dependencies.
                        Therefore we might want to remove the automatic validation of Profiles in the ProfileService and let the caller decide when to validate.

                        So i'll do something else in the meantime and let you work on that a bit. I can continue later and finish the remaining stuff on my todo list.
                        This is also good so that you can check if you actually like my changes :)

                        • 24. Re: The DeploymentManager and ProfileService
                          starksm64

                          I'm running into a few issues with trying to run an embedded AS testcase given just this type of unit test code:

                          @Profile(name="ejb3")
                          @ProfileDeployment(name="EmbeddedSessionUnitTest", pkg="org.jboss.test.ejb3.basic")
                          public class EmbeddedSessionUnitTest
                           extends EmbeddedTestCase
                          {
                          
                           public EmbeddedSessionUnitTest(String name)
                           {
                           super(name);
                           }
                          
                           public void testSession()
                           throws Exception
                           {
                           InitialContext ctx = getInitialContext();
                           String jndiName = "ejb3/basic/SimpleSessionBean";
                           Object ref = ctx.lookup(jndiName);
                           SimpleSession test = (SimpleSession) ref;
                           test.ping();
                           }
                          }
                          
                          @Profile(name="naming")
                          public class EmbeddedTestCase
                           extends AbstractTestCaseWithSetup
                          {
                          ...
                          }
                          


                          where the notion is that the test classes require "ejb3" and "naming" subprofiles, and has a dynamic deployment that will be made up of the ejbs visible in the "org.jboss.test.ejb3.basic" packages and its subpackages. This is the coarsest description of a subprofile. More generally this would include some criteria expression.

                          Now the issues are:
                          1. The JBossEmbeddedAS needs to accept richer input to allow metadata such as the inmemory deployment information.
                          https://jira.jboss.org/jira/browse/EMB-19

                          2. I'm having some class loading problems with CNFEs, CNFs for some of the security and ejb3 classes when using JBossEmbeddedAS to boot the server/embedded profile in jbossas trunk. Still need to drill into that.

                          3. The ProfileServiceBootstrap needs to call the AbstractBootstrapProfileFactory createProfile(Map profiles, List subProfiles, ProfileKey key, List profileMetaData) method as there may be ProfileMetaData coming in from the bootstrap environment.

                          4. We need the ability to have multiple ProfileFactorys that are either associated with a ProfileMetaData or tolerant of ProfileMetaData they don't understand so that a mixture of profile implementations can be built up.

                          I'm working on 3-4 today.


                          • 25. Re: The DeploymentManager and ProfileService
                            emuckenhuber

                             

                            "scott.stark@jboss.org" wrote:

                            3. The ProfileServiceBootstrap needs to call the AbstractBootstrapProfileFactory createProfile(Map profiles, List subProfiles, ProfileKey key, List profileMetaData) method as there may be ProfileMetaData coming in from the bootstrap environment.

                            Hmm well the AbstractBootstrapProfileFactory is a rough prototype and it might not be valid.
                            I think it would be good if it also activates the profiles in more or less the correct order,
                            so that we can get rid of the implicit dependencies i was mentioning before.

                            "scott.stark@jboss.org" wrote:

                            4. We need the ability to have multiple ProfileFactorys that are either associated with a ProfileMetaData or tolerant of ProfileMetaData they don't understand so that a mixture of profile implementations can be built up.


                            Yes there should be more ProfileFactories, at the moment it is all delegated to the DeploymentRepository,
                            but as i was mentioning already most of that could be done by the Profile itself.

                            • 26. Re: The DeploymentManager and ProfileService
                              emuckenhuber

                               

                              "scott.stark@jboss.org" wrote:

                              1. The JBossEmbeddedAS needs to accept richer input to allow metadata such as the inmemory deployment information.
                              https://jira.jboss.org/jira/browse/EMB-19


                              Hmm inmemory deployment - so that you don't need to create a physical jar?
                              Wouldn't that then be just another Profile implementation which actually creates the deployments?

                              I guess @Profile would be similar to the sub-profile in xml then - where you basically
                              just choose a required profile for the unit test?


                              • 27. Re: The DeploymentManager and ProfileService
                                starksm64

                                 

                                "emuckenhuber" wrote:

                                Hmm inmemory deployment - so that you don't need to create a physical jar?
                                Wouldn't that then be just another Profile implementation which actually creates the deployments?

                                Yes, that is what I'm trying out. Right now I'm looking to see if I can just use the existing ProfileMetaData with an vfsmemory://xxx url. I need a new ProfileFactory to handle this, and support for multiple ProfileFactorys.

                                "emuckenhuber" wrote:

                                I guess @Profile would be similar to the sub-profile in xml then - where you basically
                                just choose a required profile for the unit test?

                                Yes, I'll probably change that to @ProfileRef to avoid name clashes with the Profile interface. The @Profiles are showing up as the subprofiles in the ProfileMetaData.


                                1 2 Previous Next