com.holonplatform.jdbc.internal.DefaultDataSourceBuilderConfiguration Maven / Gradle / Ivy
/*
* Copyright 2016-2017 Axioma srl.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.holonplatform.jdbc.internal;
import java.io.Serializable;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.WeakHashMap;
import javax.annotation.Priority;
import com.holonplatform.core.internal.Logger;
import com.holonplatform.core.internal.utils.ClassUtils;
import com.holonplatform.core.internal.utils.ObjectUtils;
import com.holonplatform.jdbc.DataSourceBuilder;
import com.holonplatform.jdbc.DataSourceConfigProperties;
import com.holonplatform.jdbc.DataSourceFactory;
import com.holonplatform.jdbc.DataSourcePostProcessor;
/**
* Class to load and provide default {@link DataSourceFactory}s and {@link DataSourcePostProcessor}s obtained using
* standard Java extensions loader from MET-INF/services
.
*
* @since 5.0.0
*/
public final class DefaultDataSourceBuilderConfiguration implements Serializable {
private static final long serialVersionUID = -1022841607822021462L;
/**
* Logger
*/
private static final Logger LOGGER = JdbcLogger.create();
/**
* Default factories by ClassLoader
*/
private static final Map> FACTORIES = new WeakHashMap<>();
/**
* Default post processors by ClassLoader
*/
private static final Map> POST_PROCESSORS = new WeakHashMap<>();
/**
* Default type name by ClassLoader
*/
private static final Map DEFAULT_TYPE = new WeakHashMap<>();
/**
* {@link Priority} based comparator.
*/
private static final Comparator
© 2015 - 2025 Weber Informatics LLC | Privacy Policy