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

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

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

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

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

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

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

      if (pool.getConnectionListener() != null)
      {
         writer.writeStartElement(XML.ELEMENT_CONNECTION_LISTENER);
         writer.writeAttribute(XML.ATTRIBUTE_CLASS_NAME,
                               pool.getConnectionListener().getValue(XML.ATTRIBUTE_CLASS_NAME,
                                                                     pool.getConnectionListener().getClassName()));

         if (!pool.getConnectionListener().getConfigPropertiesMap().isEmpty())
         {
            Iterator<Map.Entry<String, String>> it =
               pool.getConnectionListener().getConfigPropertiesMap().entrySet().iterator();
            
            while (it.hasNext())
            {
               Map.Entry<String, String> entry = it.next();

               writer.writeStartElement(XML.ELEMENT_CONFIG_PROPERTY);
               writer.writeAttribute(XML.ATTRIBUTE_NAME, entry.getKey());
               writer.writeCharacters(pool.getConnectionListener().getValue(XML.ELEMENT_CONFIG_PROPERTY,
                                                                            entry.getKey(), entry.getValue()));
               writer.writeEndElement();
            }
         }

         writer.writeEndElement();
      }

      writer.writeEndElement();
   }
protected void storePool ( DsPool pool , XMLStreamWriter writer ) throws Exception { writer . writeStartElement ( XML . ELEMENT_POOL ) ; if ( pool . getMinPoolSize ( ) != null && ( pool . hasExpression ( XML . ELEMENT_MIN_POOL_SIZE ) || ! Defaults . MIN_POOL_SIZE . equals ( pool . getMinPoolSize ( ) ) ) ) { writer . writeStartElement ( XML . ELEMENT_MIN_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( XML . ELEMENT_MIN_POOL_SIZE , pool . getMinPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getInitialPoolSize ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_INITIAL_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( XML . ELEMENT_INITIAL_POOL_SIZE , pool . getInitialPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getMaxPoolSize ( ) != null && ( pool . hasExpression ( XML . ELEMENT_MAX_POOL_SIZE ) || ! Defaults . MAX_POOL_SIZE . equals ( pool . getMaxPoolSize ( ) ) ) ) { writer . writeStartElement ( XML . ELEMENT_MAX_POOL_SIZE ) ; writer . writeCharacters ( pool . getValue ( XML . ELEMENT_MAX_POOL_SIZE , pool . getMaxPoolSize ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . isPrefill ( ) != null && ( pool . hasExpression ( XML . ELEMENT_PREFILL ) || ! Defaults . PREFILL . equals ( pool . isPrefill ( ) ) ) ) { writer . writeStartElement ( XML . ELEMENT_PREFILL ) ; writer . writeCharacters ( pool . getValue ( XML . ELEMENT_PREFILL , pool . isPrefill ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getFlushStrategy ( ) != null && ( pool . hasExpression ( XML . ELEMENT_FLUSH_STRATEGY ) || ! Defaults . FLUSH_STRATEGY . equals ( pool . getFlushStrategy ( ) ) ) ) { writer . writeStartElement ( XML . ELEMENT_FLUSH_STRATEGY ) ; writer . writeCharacters ( pool . getValue ( XML . ELEMENT_FLUSH_STRATEGY , pool . getFlushStrategy ( ) . toString ( ) ) ) ; writer . writeEndElement ( ) ; } if ( pool . getCapacity ( ) != null ) storeCapacity ( pool . getCapacity ( ) , writer ) ; if ( pool . getConnectionListener ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_CONNECTION_LISTENER ) ; writer . writeAttribute ( XML . ATTRIBUTE_CLASS_NAME , pool . getConnectionListener ( ) . getValue ( XML . ATTRIBUTE_CLASS_NAME , pool . getConnectionListener ( ) . getClassName ( ) ) ) ; if ( ! pool . getConnectionListener ( ) . getConfigPropertiesMap ( ) . isEmpty ( ) ) { Iterator < Map . Entry < String , String > > it = pool . getConnectionListener ( ) . getConfigPropertiesMap ( ) . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < String , String > entry = it . next ( ) ; writer . writeStartElement ( XML . ELEMENT_CONFIG_PROPERTY ) ; writer . writeAttribute ( XML . ATTRIBUTE_NAME , entry . getKey ( ) ) ; writer . writeCharacters ( pool . getConnectionListener ( ) . getValue ( XML . ELEMENT_CONFIG_PROPERTY , entry . getKey ( ) , entry . getValue ( ) ) ) ; writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; }
Store a pool
@param pool The pool
@param writer The writer
@exception Exception Thrown if an error occurs