Package org.jenkinsci.remoting
Interface SerializableOnlyOverRemoting
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ClassLoaderHolder,Pipe,RemoteInputStream,RemoteOutputStream,RemoteWriter
This interface indicates objects which are
Serializable only for sending over the Remoting Channel.
Usually it means that the object requires export of the class via Channel
and hudson.remoting.ExportTable.
Attempts to serialize the instance of this interface for different purposes lead to undefined behavior.- Since:
- 3.14
- Author:
- Oleg Nenashev
-
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelGets current channel or fails withNotSerializableException.
-
Method Details
-
getChannelForSerialization
@NonNull @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) default Channel getChannelForSerialization() throws NotSerializableExceptionGets current channel or fails withNotSerializableException. This method is designed for serialization/deserialization methods in the channel.- Returns:
- Current channel
- Throws:
NotSerializableException- the calling thread has no associated channel. In such case the object cannot be serialized.
-