Class ConnectionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.loomcache.common.exception.LoomException
com.loomcache.common.exception.ConnectionException
- All Implemented Interfaces:
Serializable
Thrown when a connection cannot be established or maintained.
This exception indicates a network-level problem communicating with a remote peer. Common causes include: - Network unreachable - Connection refused - Connection reset or closed - DNS resolution failures - SSL/TLS handshake failures
Clients may choose to retry the operation, use an alternative peer, or implement exponential backoff and circuit breaker patterns.
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of connection error types. -
Constructor Summary
ConstructorsConstructorDescriptionConnectionException(String message) Creates a new ConnectionException with message.ConnectionException(String message, @Nullable String remoteAddress, @Nullable String remotePort, ConnectionException.ConnectionError errorType, @Nullable Throwable cause) Creates a new ConnectionException with detailed information.ConnectionException(String message, Throwable cause) Creates a new ConnectionException with message and cause. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConnectionException
-
ConnectionException
Creates a new ConnectionException with message.- Parameters:
message- the error message
-
ConnectionException
public ConnectionException(String message, @Nullable String remoteAddress, @Nullable String remotePort, ConnectionException.ConnectionError errorType, @Nullable Throwable cause) Creates a new ConnectionException with detailed information.- Parameters:
message- the error messageremoteAddress- the address of the remote peerremotePort- the port of the remote peererrorType- the type of connection errorcause- the underlying cause
-
-
Method Details
-
getRemoteEndpoint
Gets the full remote endpoint address.- Returns:
- address:port if both are available, or null if not specified
-