Package org.jenkinsci.remoting
Class ChannelStateException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- org.jenkinsci.remoting.ChannelStateException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ChannelClosedException
public class ChannelStateException extends IOException
Indicates invalid state of the channel during the operation. Exception stores the channel reference is aWeakReference
, so the information may be deallocated at any moment. Former channel name can be retrieved viagetChannelName()
. The reference also will not be serialized.- Since:
- 3.15
- Author:
- Oleg Nenashev
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChannelStateException(Channel channel, String message)
ChannelStateException(Channel channel, String message, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Channel
getChannel()
Gets channel associated with the exception.String
getChannelName()
Gets channel name.WeakReference<Channel>
getChannelRef()
String
getMessage()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
getChannelRef
@CheckForNull public WeakReference<Channel> getChannelRef()
-
getChannelName
@NonNull public String getChannelName()
Gets channel name.- Returns:
- Channel name ot
unknown
if it is not known.
-
getChannel
@CheckForNull public Channel getChannel()
Gets channel associated with the exception. The channel reference is aWeakReference
, so the information may be deallocated at any moment. Former channel name can be retrieved viagetChannelName()
. The reference also will not be serialized.- Returns:
- Channel reference if it is available.
null
otherwise.
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-