1 2 3 Previous Next 69 Replies Latest reply on May 28, 2010 7:11 PM by David Lloyd

    domain.xml work

    Scott Stark Master

      Here is an initial example of the domain.xml effort. The notion is  that the domain.xml is a static metadata model of an API for configuring  the server. This can be use for a rest client, command line client,  junit client, etc.

       

      The relatively easy part is deciding what features we  want to support via the model. The issues to resolve are how to:

      1. Map this metadata onto the admin API of the profileservice. In  general the domain.xml is a subset of the full metadata the service  supports. The ManagedComponent view of the deployment metadata is the  full featured configuration.

      2. Provide a plug in to handle the  mapping of the domain.xml metadata onto the ManagedComponent associated  with the domain.xml element namespace. Currently the ManagedComponent is  a view that is generated after deployment.

      3. Deal with the different mechanisms for producing the runtime  components from metadata. Some layers are using BeanMetaDataFactorys,  jboss-managed plugins, custom deployers to manipulate metadata. Pulling  in the domain.xml element override at the correct phase in the  deployment chain is an issue.

      4. Dealing with rollbacks of the domain.xml if we allow direct  editing of the a domain.xml file. If the domain.xml is essentially a  subset of admin edits of the available ManagedComponents, a rollback  needs to write out a revised domain.xml that corresponds to the previous  subset view.

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!--
          The JBoss ApplicationServer domain configuration file.
      -->
      <domain xmlns="urn:jboss:profileservice:domain:1.0"
              xmlns:xi="http://www.w3.org/2001/XInclude">

       

          <server name="server1" xmlns="urn:jboss:profileservice:server:1.0">
                  <properties>
                  <property name="timeout">3000</property>
                  <!-- Enable EAR classloader isolation. -->
                  <property name="classloaderIsolation">true</property>
                  </properties>
                  <shutdown-timeout>3600000</shutdown-timeout>
          </server>

       

         <jdbc-resources xmlns="urn:jboss:profileservice:jdbc-resources:1.0">
            <jdbc-resource jndi-name="jdbc/TimerPool" pool-name="TimerPool" enabled="true">
               <min-pool-size>1</min-pool-size>
               <max-pool-size>10</max-pool-size>
               <username>userx</username>
               <password>passy</password>
               <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
               <properties>
                  <entry key="query-timeout" value="30" />
                  <entry key="new-connection-sql" value="select * from x" />
               </properties>
            </jdbc-resource>
            <jdbc-resource jndi-name="java:DefaultDS" pool-name="DefaultDS" enabled="true">
               <min-pool-size>1</min-pool-size>
               <max-pool-size>10</max-pool-size>
               <username>sa</username>
               <password></password>
               <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
               <driver-class>org.hsqldb.jdbcDriver</driver-class>
               <type-mapping>Hypersonic SQL</type-mapping>
               <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
               <properties>
                  <entry key="query-timeout" value="30" />
                  <entry key="new-connection-sql" value="select * from x" />
                  <entry key="idle-timeout-minutes" value="0" />
                  <entry key="track-statements" value="true" />
                  <entry key="security-domain" value="HsqlDbRealm" />
                  <entry key="prepared-statement-cache-size" value="32" />
               </properties>
            </jdbc-resource>
           </jdbc-resources>

       

         <jms-resources xmls="urn:jboss:profileservice:jms-resources:1.0">
            <topic name="topic/MyTopic" />
            <queue name="queue/MyQueue">
               <depends name="someDependencyRealNameNotJMXObjectName" />
            </queue>
         </jms-resources>

       

           <threads xmlns="urn:jboss:profileservice:threads:1.0">

       

            <!-- The system thread group for all JBoss threads. -->
            <thread-group name="SystemThreadGroup" group-name="System Threads" daemon="true"/>
            <!--
              ~ This thread pool is for SHORT-RUNNING tasks that block very little or not at all.  Long-running
              ~ tasks submitted to this pool may cause starvation and extended blocking.
              -->
            <thread-group name="ShortTasksThreadGroup" group-name="Short Tasks Threads">
               <parent-thread-group name="SystemThreadGroup"/>
            </thread-group>
            <!--
              ~ This thread pool is for LONG-RUNNING tasks that may block for extended periods, such as
              ~ blocking I/O network connection threads.  Short-running tasks submitted to this pool may
              ~ cause excessive lock contention and performance degradation.
              -->
            <thread-group name="LongTasksThreadGroup" group-name="Long Tasks Threads">
               <parent-thread-group name="SystemThreadGroup"/>
            </thread-group>

       

            <!-- A simple direct executor which is always available for use. -->
            <executor name="DirectExecutor" type="direct">

       

            </executor>
            <executor name="BoundedThreadPool" type="bounded-queue-thread-pool">
                <entry key="blocking" value="true" />
                <entry key="thread-factory" value="ShortTasksThreadFactory"/>
                <entry key="queue-length.count" value="500"/>
                <entry key="queue-length.per-cpu" value="200"/>
                <entry key="core-threads.count" value="5"/>
                <entry key="core-threads.per-cpu" value="2"/>
                <entry key="max-threads.count" value="10"/>
                <entry key="max-threads.per-cpu" value="3"/>
                <entry key="keepalive.time" value="30"/>
                <entry key="keepalive.time-unit" value="seconds"/>
               <!--
               <task-filter>
                  <clear-context-classloader/>
                  <clear-tls/>
               </task-filter>
                -->
            </executor>
            <executor name="LongRunningTasksThreadPool" type="queueless-thread-pool">
                <entry key="blocking" value="true" />
                <entry key="thread-factory" value="LongTasksThreadFactory"/>
            <!--
                  <task-filter>
                  <clear-context-classloader/>
                  <clear-tls/>
               </task-filter>
            -->
            </executor>

       

            <thread-factory name="ShortTasksThreadFactory">
               <thread-group name="ShortTasksThreadGroup"/>
            </thread-factory>
            <thread-factory name="LongTasksThreadFactory">
               <thread-group name="LongTasksThreadGroup"/>
            </thread-factory>

       

         </threads>

       

         <system-properties>

            <entry key="tmp.dir"  value="/usr/tmp"/>

         </system-properties>

       

      <!-- TODO, metadata for the various cotainers, transport, apps, etc -->

      </domain>

       

        • 1. Re: domain.xml work
          Emanuel Muckenhuber Master

          I think the mapping onto profileservice itself should be quite separate from the domain model

           

          So in a nutshel the operations related to profileservice should be not more than:

           

          a) createNewDeployment()

          b) addRequirement()

          c) addCapability()

          d) addMetaDataOverrideFragment()

          e) addConfigurationFragment()

           

          a,b,c should be fairly easy - since this is what a profile does.

          d) would define a meta-data override of a existing deployment - like <component-ref />

          e) is something where we don't have a notion for it now. This would be a service configuration e.g. <connector /> which does not neccearily create a bean nor deployment. Maybe this just maps to a injection of the metadata from the repository.

           

          (d) and (e) would populate the unprocessed domain.xml fragements to a MetaDataRepository in a domain scope. This is needed since we have to distribute this to the whole domain - so we cannot do system property replacement there, as system properties in some cases could be just for a single instance/node e.g. ports-01.

          Additionally we also need to populate the MetaDataRepository with default values, those have to be kept separate until the point we actually do transformations/injections of the domain metadata itself. Basically to reduce the size of the domain.xml to configuration overrides - additionally we can compare and only store changed values back to the domain.xml

           

          Scott Stark wrote:

           

          The relatively easy part is deciding what features we  want to support via the model. The issues to resolve are how to:

          1. Map this metadata onto the admin API of the profileservice. In  general the domain.xml is a subset of the full metadata the service  supports. The ManagedComponent view of the deployment metadata is the  full featured configuration.

          2. Provide a plug in to handle the  mapping of the domain.xml metadata onto the ManagedComponent associated  with the domain.xml element namespace. Currently the ManagedComponent is  a view that is generated after deployment.

          3. Deal with the different mechanisms for producing the runtime  components from metadata. Some layers are using BeanMetaDataFactorys,  jboss-managed plugins, custom deployers to manipulate metadata. Pulling  in the domain.xml element override at the correct phase in the  deployment chain is an issue.

          4. Dealing with rollbacks of the domain.xml if we allow direct  editing of the a domain.xml file. If the domain.xml is essentially a  subset of admin edits of the available ManagedComponents, a rollback  needs to write out a revised domain.xml that corresponds to the previous  subset view.

           

           

          I think (2) is where we should start - where each domain.xml fragment could map to e.g. a ManagedComponent. Based on this we can do the association between the domain.xml override and default values/additional handling and value transformation. We can also create dependencies on the actual profile handling this namespace. For metrics and other runtime views, we would need to do some merging of MOs once the beans are available and the mgtView is getting loaded.

           

          (3) is the tricky part of overriding. Most probably this should be plugable and additional handler would be linked with the domain fragment itself.

           

          However if we differentiate between: a), d), e)  - this also gets easier, since we know what to do.

          for createNewDeployment() it would mean that the fragment will be a predetermined attachment e.g. creating a DataSource, ThreadPool.

           

          addMetaDataOverrideFragment() is the most expensive operation since we need to scan all attachment to identify a <component-ref /> and update the metadata passed through the deployer.

           

          with addConfigurationFragment() you should most probably just ask the repository for the metadata itself - where we just do merging default values and value transformation (system property replacement, ports) - so you can either decide to reuse the domain metadata directly or transform it yourself.

           

          (4) mostly relates to the persistence part. Where we need a way to compare and determine which values changed. During runtime this is easier since the fragments would correspond to a ManagedComponent. Where the persistence itself is the most critical piece.

           

          I don't clearly see how preserving comments would fit into a static meta data model. Maybe we can reuse the SchemaBinding to partially update the xml. So not marshalling the whole xml, just take what changed and apply it to the existing xml or something else? This is something we need to validate and check asap and then see how this fits into what you have started.

          • 2. Re: domain.xml work
            David Lloyd Master

            What's the reasoning behind having new namespaces for everything (which includes "profileservice")?

            • 3. Re: domain.xml work
              Emanuel Muckenhuber Master

              David Lloyd wrote:

               

              What's the reasoning behind having new namespaces for everything (which includes "profileservice")?

              Yeah, "profileservice" should not be mentioned in namespace, unless it's actually something directly provided through profileservice. The reason for having new namespaces for everything is more a modulartiy and plugability concern.

              Where we could connect a namespace to a module providing this "management feature" or parsing capability - where we don't require a static @XmlRoot any more. Also thinking about how our other platforms (SOA, Portal) and optional addons on top of AS could extend this model and provide their own fragments. We could also think of deferring the actual xml binding until a module is loaded and the classes are available, so that we don't have to have everything on the bootstrap classpath.

              For the moment we are going to use a static model and see how far we can push this - trying to get a clearer picture about the meta data operations needed and validate that we have a way to properly persist changes back to the domain.xml. Both will most likely influence how the DomainModel is going to look like in the end.

              • 4. Re: domain.xml work
                Scott Stark Master

                It is a static (for a given release) metadata api that defines an admin interface, so there should be a versioned namespace. I don't care what the namespace is.

                • 5. Re: domain.xml work
                  Scott Stark Master

                  Unlike our past use of xml descriptors, this domain.xml is to be promoted as a stable api. Our typical use of extensions to jaxb and dynamic content models is not approriate for this in my view.

                  • 6. Re: domain.xml work
                    Scott Stark Master

                    The problem with a simple deployment override notion is that the someone DSL for a given part of the tree is far removed from the actual deployment metadata. I think the registration has to be from deployment metadata to the namespace/xpath of the domain.xml that needs to be incorporated.

                     

                    It is the pickup of the MetaDataRepository domain scope value that is the issue. I'm suggesting that this needs to be an operation on the profileservice admin api to incorporate the edits into the ManagedComponent changes repository. I don't see that we can maintain two sets of xml representations. Thinking of it another way, the domain.xml is simply input for a simplified restful api on top of the profileservice ManagedComponent api.

                    • 8. Re: domain.xml work
                      Jason Greene Master

                      (d) and (e) would populate the unprocessed domain.xml fragements to a MetaDataRepository in a domain scope. This is needed since we have to distribute this to the whole domain - so we cannot do system property replacement there, as system properties in some cases could be just for a single instance/node e.g. ports-01.

                      Additionally we also need to populate the MetaDataRepository with default values, those have to be kept separate until the point we actually do transformations/injections of the domain metadata itself. Basically to reduce the size of the domain.xml to configuration overrides - additionally we can compare and only store changed values back to the domain.xml

                       

                      IMO something other than the MDR should be created/used to achieve this. The MDR's design is in many ways incompatible with what we actually want for a domain model. As an example, the notion of scoping is the exact opposite of how an administrator expects the domain.xml to work. An entry in the domain should *override* something expressed in a deployment, not the other way around.

                      • 9. Re: domain.xml work
                        Emanuel Muckenhuber Master

                        Jason Greene wrote:


                        IMO something other than the MDR should be created/used to achieve this. The MDR's design is in many ways incompatible with what we actually want for a domain model. As an example, the notion of scoping is the exact opposite of how an administrator expects the domain.xml to work. An entry in the domain should *override* something expressed in a deployment, not the other way around.

                        Yes, i was not really referring to the MDR - rather to a general concept of a meta data repository, since MDR does not really fit the needs of the domain metadata. Where we create a more generic way of handling domain metadata entries within ProfileService.

                        • 10. Re: domain.xml work
                          Scott Stark Master

                          Yes, that is correct, but that would be an artifact of the domain.xml representing something that does not exist anywhere but the domain level. The only time a deployment would have an override is if it included a domain.xml fragment. This would be a syntactic shortcut to editing the deployment via the profileservice ManagedComponent api. I'm not suggesting that we support that.

                           

                          I'm not even sure the MetaDataRepository should be involved because I view the domain.xml as essentially a script to run against the lower level ManagedComponent api. That is the only where there is going to be a consistent admin edit view of the server profile/content repository.

                          • 11. Re: domain.xml work
                            Jason Greene Master

                            Scott Stark wrote:

                             

                            Unlike our past use of xml descriptors, this domain.xml is to be promoted as a stable api. Our typical use of extensions to jaxb and dynamic content models is not approriate for this in my view.

                             

                            I agree. Any form of extensibility we add will have to be done in a limited way that is clearly identifiable to the user . "Dragons be here"

                            • 12. Re: domain.xml work
                              Scott Stark Master

                              Let's take a step back and review what we support today in 5.x. We have an api that exposes ManagedComponents for the deployment metadata that has been marked up as being part of the admin interface. This provides a facade on top of the implementation details of the deployers that transform the metadata into runtime components. There is an expectation that the ManagedComponent view is stable, but there is no enforcement of this.

                               

                              We have embedded JON using this API along with its own notion of components to expose the admin-console view of the ManagedComponents. this imposes something of an enforcement of the ManagedComponent since if the console breaks, jiras get raised and the incompatible change needs to be resolved.

                               

                              The domain.xml notion is essentially a unification of the embedded JON component descriptions into a single metadata view to allow for simple configuration of the server via scripting, etc. As such, a given domain.xml instance is just a series of ManagedComponent property updates. I view the domain.xml as just another "user" of the profile service ManagedComponent api.

                               

                              The following set of steps would each produce new sets of ManagedComponent property changes:

                               

                              1. An initial domain.xml transforms the state of ManagedComponent properties from the new build state into some initial distribution state. There is a V1 repository of ManagedComponent property overrides.

                              2. embedded JON/JON updates provide a further set of changes. Where these properties intersect the metadata values of the domain.xml, it would have to be updated if we are going to allow direct editing of a server domain.xml. There is a V2 repository of ManagedComponent property overrides.

                              3. A rest client manipulates the current server domain metadata to push further updates. There is a V3 repository of ManagedComponent property overrides.

                               

                              There is only one authoritative store of ManagedComponent property edits that the profileservice implementation manages. Any physical domain.xml is a filtered view of this store.

                              • 13. Re: domain.xml work
                                Emanuel Muckenhuber Master

                                I was not really talking about overrides itself. This should be rather a generic processing extracting domain metadata fragments on a ManagedComponent level, so that they can be used for further processing. I also thought that the deployment metadata would register the namespace for overrides. However i think we should also look at different use cases which don't need a physical deployment - therefore createNewDeployment() - this would still need the meta value transformations, however we don't need to scan existing attachments

                                 

                                Also (d) just adding configuration would be only useful for MC Beans - the reason why this could be interesting is that ProfileService does not know in which deployment a MC bean is located to override it - so we would need to go through all MC beans and check if this fragment applies there. In this case it might be more interesting to add a way to inject a configuration fragment into your MC bean itself.

                                • 14. Re: domain.xml work
                                  Jason Greene Master

                                  Scott Stark wrote:

                                   

                                  The following set of steps would each produce new sets of ManagedComponent property changes:

                                   

                                  1. An initial domain.xml transforms the state of ManagedComponent properties from the new build state into some initial distribution state. There is a V1 repository of ManagedComponent property overrides.

                                  2. embedded JON/JON updates provide a further set of changes. Where these properties intersect the metadata values of the domain.xml, it would have to be updated if we are going to allow direct editing of a server domain.xml. There is a V2 repository of ManagedComponent property overrides.

                                  3. A rest client manipulates the current server domain metadata to push further updates. There is a V3 repository of ManagedComponent property overrides.

                                   

                                  There is only one authoritative store of ManagedComponent property edits that the profileservice implementation manages. Any physical domain.xml is a filtered view of this store.

                                   

                                  It definitely seems like domain.xml is a subset if we support the ability for frameworks to define managed components that are not part of our official domain.xml. This definitely includes runtime-only views, but it really could be anything.

                                   

                                  There are some general questions I have relating to this (not necessarily expecting that we know the answer to these yet).

                                   

                                  1. The current ManagedComponent model is flat, but the things we are talking about in domain.xml hierarchical. For example, JON will need the ability to define a data source at the domain, cluster, or node level. How should this be mapped? I suppose it could be a jmx-style attribute list on the ManagedComponent (type=Datasource, level=domain)
                                  2. Are components created from deployments differentiated from those in the domain? As an example someone includes foo-ds.xml in a deployment. Do we implicitly map this as a node level concept in a domain?
                                  3. Assuming the answer to the latter question in 2 is yes, what happens when JON updates this definition? In the past we talked about having it add the entry to the domain.xml, and subsequent restarts the domain would take precedent.
                                  4. Are components not in the formal domain definition visible to other nodes in the domain? As an example someone creates FooDeployer, and FooDeployer creates FooComponent. I assume the answer to this question is no.
                                  5. If the answer is no, how does a client know that these elements are not part of the "official" api?
                                  1 2 3 Previous Next