Package com.mysql.cj.exceptions
Class ExceptionFactory
java.lang.Object
com.mysql.cj.exceptions.ExceptionFactory
public class ExceptionFactory
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description ExceptionFactory() -
Method Summary
Modifier and Type Method Description static CJCommunicationsExceptioncreateCommunicationsException(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.Throwable cause, ExceptionInterceptor interceptor)static <T extends CJException>
TcreateException(java.lang.Class<T> clazz, java.lang.String message)static <T extends CJException>
TcreateException(java.lang.Class<T> clazz, java.lang.String message, ExceptionInterceptor interceptor)static <T extends CJException>
TcreateException(java.lang.Class<T> clazz, java.lang.String message, java.lang.Throwable cause)static <T extends CJException>
TcreateException(java.lang.Class<T> clazz, java.lang.String message, java.lang.Throwable cause, ExceptionInterceptor interceptor)static CJExceptioncreateException(java.lang.String message)static CJExceptioncreateException(java.lang.String message, ExceptionInterceptor interceptor)static CJExceptioncreateException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, java.lang.Throwable cause, ExceptionInterceptor interceptor)static CJExceptioncreateException(java.lang.String message, java.lang.Throwable cause)static CJExceptioncreateException(java.lang.String message, java.lang.Throwable cause, ExceptionInterceptor interceptor)static java.lang.StringcreateLinkFailureMessageBasedOnHeuristics(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.Throwable underlyingException)Creates a communications link failure message to be used in CommunicationsException that (hopefully) has some better information and suggestions based on heuristics.
-
Constructor Details
-
ExceptionFactory
public ExceptionFactory()
-
-
Method Details
-
createException
-
createException
public static <T extends CJException> T createException(java.lang.Class<T> clazz, java.lang.String message) -
createException
public static CJException createException(java.lang.String message, ExceptionInterceptor interceptor) -
createException
public static <T extends CJException> T createException(java.lang.Class<T> clazz, java.lang.String message, ExceptionInterceptor interceptor)- Type Parameters:
T-CJException- Parameters:
clazz- exception classmessage- messageinterceptor- exception interceptor- Returns:
CJExceptioninstance
-
createException
-
createException
public static <T extends CJException> T createException(java.lang.Class<T> clazz, java.lang.String message, java.lang.Throwable cause) -
createException
public static CJException createException(java.lang.String message, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createException
public static CJException createException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createException
public static <T extends CJException> T createException(java.lang.Class<T> clazz, java.lang.String message, java.lang.Throwable cause, ExceptionInterceptor interceptor)- Type Parameters:
T-CJException- Parameters:
clazz- exception classmessage- messagecause- exception caused this oneinterceptor- exception interceptor- Returns:
CJExceptioninstance
-
createCommunicationsException
public static CJCommunicationsException createCommunicationsException(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createLinkFailureMessageBasedOnHeuristics
public static java.lang.String createLinkFailureMessageBasedOnHeuristics(PropertySet propertySet, ServerSession serverSession, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.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- property setserverSession- server sessionpacketSentTimeHolder- packetSentTimeHolderpacketReceivedTimeHolder- packetReceivedTimeHolderunderlyingException- underlyingException- Returns:
- message
-