Class JoramAdminBeanDefinitionParser

  • All Implemented Interfaces:
    org.springframework.beans.factory.xml.BeanDefinitionParser

    public class JoramAdminBeanDefinitionParser
    extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
    Parser for the joram:admin xml entry.

    The joram administration attributes:

    • user (optionnal): the name of the Joram root (default “root”)
    • pass (optionnal): the password of the Joram root (default “root”)
    • host (optionnal): the host of the Joram server (default “localhost”)
    • port (optionnal): the port of the Joram server (default “16010”)
    
     A simple example:
     
     <!--  Joram administration to use  -->
     <joram:admin id="wrapper" 
      user="root" 
      pass="root" 
      host="localhost" 
      port="16010" />
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Connection cnx  
      static Logger logger  
      • Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

        ID_ATTRIBUTE, NAME_ATTRIBUTE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private AdminItf adminConnect​(boolean collocated, String user, String pass, String host, int port)
      Create the wrapper (AdminItf).
      protected void doParse​(Element element, org.springframework.beans.factory.support.BeanDefinitionBuilder bean)
      Parse the joram admin definition, and create the admin wrapper.
      protected Class getBeanClass​(Element element)  
      • Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

        doParse, getBeanClassName, getParentName, parseInternal
      • Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

        parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback
    • Constructor Detail

      • JoramAdminBeanDefinitionParser

        public JoramAdminBeanDefinitionParser()
    • Method Detail

      • getBeanClass

        protected Class getBeanClass​(Element element)
        Overrides:
        getBeanClass in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        Returns:
        the Class of JoramAdmin.
        See Also:
        AbstractSingleBeanDefinitionParser.getBeanClass(org.w3c.dom.Element)
      • doParse

        protected void doParse​(Element element,
                               org.springframework.beans.factory.support.BeanDefinitionBuilder bean)
        Parse the joram admin definition, and create the admin wrapper. By default JoramAdmin is collocated. If you set a host / port, the collocated set to false. Add the wrapper property value to the bean.
        Overrides:
        doParse in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
        See Also:
        AbstractSingleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.support.BeanDefinitionBuilder)
      • adminConnect

        private AdminItf adminConnect​(boolean collocated,
                                      String user,
                                      String pass,
                                      String host,
                                      int port)
                               throws Exception
        Create the wrapper (AdminItf).
        Parameters:
        collocated - true if Joram is colocated
        user - the admin user name
        pass - the admin password
        host - the admin host
        port - the admin port
        Returns:
        the admin wrapper
        Throws:
        Exception