@Override public SimpleConnectionFactoryConfigurationBuilder<S> read(SimpleConnectionFactoryConfiguration template) { this.connectionUrl = template.connectionUrl(); this.driverClass = template.driverClass(); this.username = template.username(); this.password = template.password(); return this; }
@Override public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException { SimpleConnectionFactoryConfiguration factoryConfiguration; if (config instanceof SimpleConnectionFactoryConfiguration) { factoryConfiguration = (SimpleConnectionFactoryConfiguration) config; } else { throw new PersistenceException("ConnectionFactoryConfiguration has to be an instance of " + "SimpleConnectionFactoryConfiguration."); } loadDriver(factoryConfiguration.driverClass(), classLoader); this.connectionUrl = factoryConfiguration.connectionUrl(); this.userName = factoryConfiguration.username(); this.password = factoryConfiguration.password(); if (trace) { log.tracef("Starting connection %s", this); } }
private void writeJDBCStoreConnection(XMLExtendedStreamWriter writer, SimpleConnectionFactoryConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.SIMPLE_CONNECTION); writeOptional(writer, Attribute.CONNECTION_URL, configuration.connectionUrl()); writeOptional(writer, Attribute.DRIVER_CLASS, configuration.driverClass()); writeOptional(writer, Attribute.USERNAME, configuration.username()); writeOptional(writer, Attribute.PASSWORD, configuration.password()); writer.writeEndElement(); }