Top Fields Constructors Methods
com.mysql.cj.exceptions

public Class ExceptionFactory

extends Object
Class Inheritance
Imports
java.net.BindException, .NetworkInterface, .SocketException, com.mysql.cj.Messages, com.mysql.cj.conf.PropertyKey, .PropertySet, com.mysql.cj.protocol.PacketReceivedTimeHolder, .PacketSentTimeHolder, .ServerSession

Field Summary

Modifier and TypeField and Description
private static final long
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static CJCommunicationsException
createCommunicationsException(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Throwable cause, ExceptionInterceptor interceptor)

public static CJException
public static <T extends CJException> T
createException(Class<T> clazz, String message)

public static CJException
public static <T extends CJException> T

Returns:

CJException instance
createException
(Class<T>
exception class
clazz
,
String
message
message
,
ExceptionInterceptor
exception interceptor
interceptor
)

public static CJException
public static <T extends CJException> T
createException(Class<T> clazz, String message, Throwable cause)

public static CJException
public static CJException
createException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)

public static <T extends CJException> T

Returns:

CJException instance
createException
(Class<T>
exception class
clazz
,
String
message
message
,
Throwable
exception caused this one
cause
,
ExceptionInterceptor
exception interceptor
interceptor
)

public static String

Returns:

message
createLinkFailureMessageBasedOnHeuristics
(PropertySet
property set
propertySet
,
ServerSession
server session
serverSession
,
PacketSentTimeHolder
packetSentTimeHolder
packetSentTimeHolder
,
PacketReceivedTimeHolder
packetReceivedTimeHolder
packetReceivedTimeHolder
,
Throwable
underlyingException
underlyingException
)

Creates a communications link failure message to be used in CommunicationsException that (hopefully) has some better information and suggestions based on heuristics.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_WAIT_TIMEOUT_SECONDSback to summary
private static final long DEFAULT_WAIT_TIMEOUT_SECONDS
DUE_TO_TIMEOUT_FALSEback to summary
private static final int DUE_TO_TIMEOUT_FALSE
DUE_TO_TIMEOUT_MAYBEback to summary
private static final int DUE_TO_TIMEOUT_MAYBE
DUE_TO_TIMEOUT_TRUEback to summary
private static final int DUE_TO_TIMEOUT_TRUE

Constructor Detail

ExceptionFactoryback to summary
public ExceptionFactory()

Method Detail

createCommunicationsExceptionback to summary
public static CJCommunicationsException createCommunicationsException(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Throwable cause, ExceptionInterceptor interceptor)
createExceptionback to summary
public static CJException createException(String message)
createExceptionback to summary
public static <T extends CJException> T createException(Class<T> clazz, String message)
Annotations
@SuppressWarnings:unchecked
createExceptionback to summary
public static CJException createException(String message, ExceptionInterceptor interceptor)
createExceptionback to summary
public static <T extends CJException> T createException(Class<T> clazz, String message, ExceptionInterceptor interceptor)
Parameters
<T>
CJException
clazz:Class<T>

exception class

message:String

message

interceptor:ExceptionInterceptor

exception interceptor

Returns:T

CJException instance

createExceptionback to summary
public static CJException createException(String message, Throwable cause)
createExceptionback to summary
public static <T extends CJException> T createException(Class<T> clazz, String message, Throwable cause)
createExceptionback to summary
public static CJException createException(String message, Throwable cause, ExceptionInterceptor interceptor)
createExceptionback to summary
public static CJException createException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)
createExceptionback to summary
public static <T extends CJException> T createException(Class<T> clazz, String message, Throwable cause, ExceptionInterceptor interceptor)
Parameters
<T>
CJException
clazz:Class<T>

exception class

message:String

message

cause:Throwable

exception caused this one

interceptor:ExceptionInterceptor

exception interceptor

Returns:T

CJException instance

createLinkFailureMessageBasedOnHeuristicsback to summary
public static String createLinkFailureMessageBasedOnHeuristics(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Throwable underlyingException)

Creates a communications link failure message to be used in CommunicationsException that (hopefully) has some better information and suggestions based on heuristics.

Parameters
propertySet:PropertySet

property set

serverSession:ServerSession

server session

packetSentTimeHolder:PacketSentTimeHolder

packetSentTimeHolder

packetReceivedTimeHolder:PacketReceivedTimeHolder

packetReceivedTimeHolder

underlyingException:Throwable

underlyingException

Returns:String

message