InternalConnectorRegistry keeps track of connectors. This class should not be used directly, but
only through the JDBC driver specific SocketFactory implementations.
WARNING: This is an internal class. The API is subject to change without notice.
Calls shutdown on the singleton and removes the singleton. After calling shutdownInstance(),
the next call to getInstance() will start a new singleton instance.
Calls shutdown on the singleton and removes the singleton. After calling shutdownInstance(),
the next call to getInstance() will start a new singleton instance.
Methods
close(String name)
publicvoidclose(Stringname)
Close a named connector, stopping the refresh process and removing it from the registry.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class InternalConnectorRegistry (1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/java/docs/reference/jdbc-socket-factory-parent/latest/com.google.cloud.sql.core.InternalConnectorRegistry)\n- [1.14.1](/java/docs/reference/jdbc-socket-factory-parent/1.14.1/com.google.cloud.sql.core.InternalConnectorRegistry) \n\n public final class InternalConnectorRegistry\n\nInternalConnectorRegistry keeps track of connectors. This class should not be used directly, but\nonly through the JDBC driver specific `SocketFactory` implementations.\n\nWARNING: This is an internal class. The API is subject to change without notice. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e InternalConnectorRegistry \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### addArtifactId(String artifactId)\n\n public static void addArtifactId(String artifactId)\n\nInternal use only: Sets the default string which is appended to the SQLAdmin API client\nUser-Agent header.\n\nThis is used by the specific database connector socket factory implementations to append\ntheir database name to the user agent.\n\n### getInstance()\n\n public static synchronized InternalConnectorRegistry getInstance()\n\nReturns the [InternalConnectorRegistry](/java/docs/reference/jdbc-socket-factory-parent/latest/com.google.cloud.sql.core.InternalConnectorRegistry) singleton.\n\n### resetInstance()\n\n public static synchronized void resetInstance()\n\nCalls shutdown on the singleton and removes the singleton. After calling shutdownInstance(),\nthe next call to getInstance() will start a new singleton instance.\n\n### setApplicationName(String applicationName)\n\n public static void setApplicationName(String applicationName)\n\nAdds an external application name to the user agent string for tracking. This is known to be\nused by the spring-cloud-gcp project.\n\n### shutdownInstance()\n\n public static synchronized void shutdownInstance()\n\nCalls shutdown on the singleton and removes the singleton. After calling shutdownInstance(),\nthe next call to getInstance() will start a new singleton instance.\n\nMethods\n-------\n\n### close(String name)\n\n public void close(String name)\n\nClose a named connector, stopping the refresh process and removing it from the registry.\n\n### connect(ConnectionConfig config)\n\n public Socket connect(ConnectionConfig config)\n\nInternal use only: Creates a socket representing a connection to a Cloud SQL instance.\n\nDepending on the given properties, it may return either a SSL Socket or a Unix Socket.\n\n### getConnectionMetadata(ConnectionConfig config)\n\n public ConnectionMetadata getConnectionMetadata(ConnectionConfig config)\n\nInternal use only: Returns ConnectionMetadata for a connection.\n\n### register(String name, ConnectorConfig config)\n\n public void register(String name, ConnectorConfig config)\n\nRegister the configuration for a named connector.\n\n### shutdown()\n\n public void shutdown()\n\nShutdown all connectors and remove the singleton instance."]]