1 2 3 Previous Next 36 Replies Latest reply on Aug 18, 2008 9:51 PM by brian.stansberry Go to original post
      • 15. Re: ProfileService equiv to ServiceBindingManager
        brian.stansberry

        This is done. https://jira.jboss.org/jira/browse/JBAS-5822

        Only other thing to point out is that using an mbean as the value factory is also supported, but only if the type of any parameters is specifically listed:

        <attribute name="Foo">
         <value-factory bean="jboss:service=FooProvider" method="getFoo" default="1100">
         <parameter class="java.lang.String">A</parameter>
         <parameter class="java.lang.Integer">1</parameter>
         </value-factory>
        </attribute>
        


        This is because if the value factory bean's ControllerContext is a ServiceControllerContext, metadata about the mbean operations exposed by the bean is not available (only attributes are available.) Without that information there is no way to "guess" the parameter types.

        • 16. Re: ProfileService equiv to ServiceBindingManager
          brian.stansberry

          Please see http://wiki.jboss.org/wiki/AS5ServiceBindingManager for a discussion of a reimplementation of SBM based on 1) making it a pojo service that 2) acts as a value-factory. The wiki page is both a design document from which I hope to get input and a first pass at documentation of how the value-factory concepts applies. Any comments appreciated. In particular, for those unwilling to stay awake through my voluminous prose, there are a few points labeled Question: where input would be helpful. :-)

          • 17. Re: ProfileService equiv to ServiceBindingManager

             


            Design Question: This inclusion of service binding in the bootstrap isn't strictly necessary, just how I've approached it so far. I did it that way because a) the service does have to be loaded early, before stuff in conf/jboss-service.xml that needs binding configuration and b) the binding configuration file is pretty long and complex and IMHO should be in its own file. The bootstrap mechanism was a quick-and-dirty way to get that file parsed and loaded into the MC.


            The issue here is that we have no conf/jboss-beans.xml equivalent
            other than the bootstrap files.

            In practice this bootstrap stage of the profile service should disappear
            once all the mbeans have been moved out of conf/jboss-service.xml

            The ServiceBindingManager would then live in deploy and automatically
            get deployed in order correctly based on MC dependencies.

            • 18. Re: ProfileService equiv to ServiceBindingManager

               


              Question: Is there any benefit to the Profile Service and/or management tools from the name="xxx" attribute on the ServiceBinding beans? If they can be anonymous, configuration will be simpler.


              As far as the profile service is concerned, it is upto the ServiceBindingManager
              to provide a ManagedObject to the profile service that allows any management
              console to understand how to configure it.
              This should include properties or ManagedObjects
              that let you configure the store/configuration file as well.

              The only reason to give a special name would be so a management console can
              identify it and give it some extra prominance or categorization, but that
              only needs to be done on the ManagedObject. The implementation details of the POJO
              should largely be hidden.

              • 19. Re: ProfileService equiv to ServiceBindingManager

                 

                "bstansberry@jboss.com" wrote:
                In particular, for those unwilling to stay awake through my voluminous prose


                Nice docs, although I made no attempt to read all the details.
                I'd be very impressed if you're testsuite has the same coverage. ;-)

                • 20. Re: ProfileService equiv to ServiceBindingManager
                  brian.stansberry

                  Re: the bootstap: Brian smacks head! Yes, of course. So this is a temporary issue. :-)

                  A key becomes getting https://jira.jboss.org/jira/browse/JBAS-5349 done so we can safely move stuff out of conf/jboss-service.xml. IMO that one should be marked critical for CR2, even if we don't move anything out of conf/jboss-service.xml for 5.0.0.

                  • 21. Re: ProfileService equiv to ServiceBindingManager
                    brian.stansberry

                    A question is what to do with the old org.jboss.system.ServiceBinding interface and it's usage in ServiceConfigurator (and OldServiceConfigurator):

                    public interface ServiceBinding
                    {
                     /**
                     * Possibly override the configuration of a service.
                     *
                     * @param serviceName the JMX ObjectName of the service
                     * @exception Exception thrown on failure to override a configuration
                     */
                     void applyServiceConfig(ObjectName serviceName) throws Exception;
                    }


                    The new implementation has nothing to do with this.

                    Possibilities:

                    1) Leave it there along with the old ServiceBindingManager code in case anyone was using it for something obscure that the new stuff couldn't handle. Minimize confusion for the 99.99% who don't fit this case by not providing the commented out mbean or the docs/examples/binding/sample-bindings.xml file.

                    2) Leave the interface there but drop the old implementation; if people want it they implement their own. This makes little sense to me.

                    3) Get rid of all of it.

                    IMO #3 is the right way to go, but want to get comments before dumping the whole thing.

                    • 22. Re: ProfileService equiv to ServiceBindingManager
                      brian.stansberry

                      Carlo raised a good point that having all the bindings in a centralized bindings.xml file is clumsy. It should be possible to add basic bindings on the fly. To support this I'm adding two things:

                      1) ServiceBindingStore has additional methods to allow addition of a binding to all of the named sets it knows about:

                       /**
                       * Add a ServiceBinding to all binding sets in the store. For each binding
                       * set, a new ServiceBinding is added whose serviceName and bindingName
                       * properties match the passed binding. The new binding's hostName matches
                       * the target set's {@link #getDefaultHostName(String) default host name}.
                       * The new binding's port is derived by taking the port from the passed
                       * binding and incrementing it by the target set's
                       * {@link #getDefaultPortOffset(String) default port offset}.
                       *
                       * @param serviceName the JMX ObjectName of the service
                       * @param serviceConfig the configuration to add
                       *
                       * @throws DuplicateServiceException thrown if a configuration for the
                       * <serverName, serviceName> pair already exists.
                       */
                       void addServiceBinding(ServiceBinding binding)
                       throws DuplicateServiceException;
                      
                       /**
                       * Remove a service configuration from all binding sets in the store.
                       *
                       * @param serviceBinding the binding
                       */
                       void removeServiceBinding(ServiceBinding binding);
                      
                       /**
                       * Remove a service configuration from all binding sets in the store.
                       *
                       * @param serviceBinding the binding
                       */
                       void removeServiceBinding(String serviceName, String bindingName);
                      
                       /**
                       * Gets the offset from a base value that by default should be added to
                       * port values for a given serverName.
                       *
                       * @param serverName the name of the binding set
                       * @return the offset
                       */
                       int getDefaultPortOffset(String serverName);
                      
                       /**
                       * Gets the default value to use as the host name for the given serverName.
                       *
                       * @param serverName the name of the binding set
                       * @return the host name
                       */
                       String getDefaultHostName(String serverName);
                      
                       /**
                       * Value of <code>InetAddress.getByHost({@link #getDefaultHostName(String) getDefaultHost(serverName)})</code>.
                       *
                       * @param serverName the name of the binding set
                       * @return the host name
                       */
                       InetAddress getDefaultBindAddress(String serverName);


                      With that, a newly deployed service could easily enough register its bindings by including a bean whose purpose is to do that.

                      Having to include such a bean is clumsy though, A simpler mechanism is to have the ServiceBindingManager methods include overloaded versions that take a base port value. If there is no matching binding, the SBM then uses that base value and adds the above defaultPortOffset to calculate the binding port.

                      • 23. Re: ProfileService equiv to ServiceBindingManager
                        brian.stansberry

                        The concern I expressed on the wiki about using ${host} and ${port} as the syntax to mark values to be replaced by SBM was well-founded. It's easily breakable due to https://jira.jboss.org/jira/browse/JBCOMMON-62, which causes the ${host} or ${port} to be removed from the string if any other property replacement succeeds.

                        Still, I think the ${host} and ${port} syntax is OK; JBCOMMON-62 needs to be fixed.

                        • 24. Re: ProfileService equiv to ServiceBindingManager
                          brian.stansberry

                           

                          "bstansberry@jboss.com" wrote:
                          A question is what to do with the old org.jboss.system.ServiceBinding interface and it's usage in ServiceConfigurator (and OldServiceConfigurator):

                          .....


                          No comments, so I'm going to get rid of this stuff now.

                          • 25. Re: ProfileService equiv to ServiceBindingManager

                            Do you have a test implementation library for the Pojo based ServiceBindingManager? The currently bundled bindingservice-plugin.jar has ServiceBinding and ServiceBindingManager implementations in it.

                            • 26. Re: ProfileService equiv to ServiceBindingManager
                              brian.stansberry

                              This implementation was just checked in -- like 30 seconds ago ;)

                              To get the implemenation jar, you'd need to check out the current head of the AS trunk and build it. Once you've done that the jar can be found in build/output/jboss-5.0.0.CR2/server/.../lib/jboss-bindingservice.jar or in varia/output/lib/jboss-bindingservice.jar

                              I'm curious what you'd do with just the jar though, as opposed to the entire AS that uses it (which the current head now does.)

                              • 27. Re: ProfileService equiv to ServiceBindingManager
                                brian.stansberry

                                The current AS trunk has been switched over to this new impl. There are still two services that are not integrated properly with it, so starting two servers using SBM will not work. But it didn't work before either; so now at least people can work off of the new implementation.

                                The testsuite includes a tests-binding-manager target that starts two instances with the same -b but different binding sets and confirms all services deploy on both. This passes, because I used a couple test-configs to work around the 2 missing services.

                                The main testing of this is in the varia and system-jmx projects.

                                Threads discussing the 2 remaining missing services:

                                1) JBM: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169967#4169967

                                2) TransactionManager: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=140667

                                The latter will require a new jbossts release; former is more a coordination issue.

                                • 28. Re: ProfileService equiv to ServiceBindingManager

                                  Just grabbed the trunk and built. Is it safe to say that the old MX based ServiceBinding used in AS 4 does not work in AS 5.0?

                                  • 29. Re: ProfileService equiv to ServiceBindingManager
                                    brian.stansberry

                                    Correct. From a few posts back:

                                    "bstansberry@jboss.com" wrote:
                                    "bstansberry@jboss.com" wrote:
                                    A question is what to do with the old org.jboss.system.ServiceBinding interface and it's usage in ServiceConfigurator (and OldServiceConfigurator):

                                    .....


                                    No comments, so I'm going to get rid of this stuff now.