protected void storePool(Pool pool, XMLStreamWriter writer) throws Exception
   {
      writer.writeStartElement(CommonXML.ELEMENT_POOL);

      if (pool.getType() != null)
         writer.writeAttribute(CommonXML.ATTRIBUTE_TYPE,
                               pool.getValue(CommonXML.ATTRIBUTE_TYPE, pool.getType()));

      if (pool.getJanitor() != null)
         writer.writeAttribute(CommonXML.ATTRIBUTE_JANITOR,
                               pool.getValue(CommonXML.ATTRIBUTE_JANITOR, pool.getJanitor()));

      if (pool.getMinPoolSize() != null && (pool.hasExpression(CommonXML.ELEMENT_MIN_POOL_SIZE) ||
                                            !Defaults.MIN_POOL_SIZE.equals(pool.getMinPoolSize())))
      {
         writer.writeStartElement(CommonXML.ELEMENT_MIN_POOL_SIZE);
         writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_MIN_POOL_SIZE, pool.getMinPoolSize().toString()));
         writer.writeEndElement();
      }

      if (pool.getInitialPoolSize() != null)
      {
         writer.writeStartElement(CommonXML.ELEMENT_INITIAL_POOL_SIZE);
         writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_INITIAL_POOL_SIZE,
                                              pool.getInitialPoolSize().toString()));
         writer.writeEndElement();
      }

      if (pool.getMaxPoolSize() != null && (pool.hasExpression(CommonXML.ELEMENT_MAX_POOL_SIZE) ||
                                            !Defaults.MAX_POOL_SIZE.equals(pool.getMaxPoolSize())))
      {
         writer.writeStartElement(CommonXML.ELEMENT_MAX_POOL_SIZE);
         writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_MAX_POOL_SIZE, pool.getMaxPoolSize().toString()));
         writer.writeEndElement();
      }

      if (pool.isPrefill() != null && (pool.hasExpression(CommonXML.ELEMENT_PREFILL) ||
                                       !Defaults.PREFILL.equals(pool.isPrefill())))
      {
         writer.writeStartElement(CommonXML.ELEMENT_PREFILL);
         writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_PREFILL, pool.isPrefill().toString()));
         writer.writeEndElement();
      }

      if (pool.getFlushStrategy() != null && (pool.hasExpression(CommonXML.ELEMENT_FLUSH_STRATEGY) ||
                                              !Defaults.FLUSH_STRATEGY.equals(pool.getFlushStrategy())))
      {
         writer.writeStartElement(CommonXML.ELEMENT_FLUSH_STRATEGY);
         writer.writeCharacters(pool.getValue(CommonXML.ELEMENT_FLUSH_STRATEGY, pool.getFlushStrategy().toString()));
         writer.writeEndElement();
      }

      if (pool.getCapacity() != null)
         storeCapacity(pool.getCapacity(), writer);

      writer.writeEndElement();
   }
protected void storePool ( Pool pool , XMLStreamWriter writer ) throws Exception { writer . writeStartElement ( CommonXML . ELEMENT_POOL ) ; if ( pool . getType ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_TYPE , pool . getValue ( CommonXML . ATTRIBUTE_TYPE , pool . getType ( ) ) ) ; if ( pool . getJanitor ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_JANITOR , pool . getValue ( CommonXML . ATTRIBUTE_JANITOR , pool . getJanitor ( ) ) ) ; if ( pool . getMinPoolSize ( ) != null && ( pool . hasExpression ( CommonXML . ELEMENT_MIN_POOL_SIZE ) || ! Defaults . MIN_POOL_SIZE . equals ( pool . getMinPoolSize ( ) ) ) ) { writer . writeStartElement ( CommonXML . ELEMENT_MIN_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( CommonXML . ELEMENT_MIN_POOL_SIZE , pool . getMinPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getInitialPoolSize ( ) != null ) { writer . writeStartElement ( CommonXML . ELEMENT_INITIAL_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( CommonXML . ELEMENT_INITIAL_POOL_SIZE , pool . getInitialPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getMaxPoolSize ( ) != null && ( pool . hasExpression ( CommonXML . ELEMENT_MAX_POOL_SIZE ) || ! Defaults . MAX_POOL_SIZE . equals ( pool . getMaxPoolSize ( ) ) ) ) { writer . writeStartElement ( CommonXML . ELEMENT_MAX_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( CommonXML . ELEMENT_MAX_POOL_SIZE , pool . getMaxPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . isPrefill ( ) != null && ( pool . hasExpression ( CommonXML . ELEMENT_PREFILL ) || ! Defaults . PREFILL . equals ( pool . isPrefill ( ) ) ) ) { writer . writeStartElement ( CommonXML . ELEMENT_PREFILL ) ; writer . writeCharacters ( pool . getValue ( CommonXML . ELEMENT_PREFILL , pool . isPrefill ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getFlushStrategy ( ) != null && ( pool . hasExpression ( CommonXML . ELEMENT_FLUSH_STRATEGY ) || ! Defaults . FLUSH_STRATEGY . equals ( pool . getFlushStrategy ( ) ) ) ) { writer . writeStartElement ( CommonXML . ELEMENT_FLUSH_STRATEGY ) ; writer . writeCharacters ( pool . getValue ( CommonXML . ELEMENT_FLUSH_STRATEGY , pool . getFlushStrategy ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getCapacity ( ) != null ) storeCapacity ( pool . getCapacity ( ) , writer ) ; writer . writeEndElement ( ) ; }
Store a pool
@param pool The pool
@param writer The writer
@exception Exception Thrown if an error occurs