Package org.jenkinsci.remoting
Interface SerializableOnlyOverRemoting
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ClassLoaderHolder
,Pipe
,RemoteInputStream
,RemoteOutputStream
,RemoteWriter
public interface SerializableOnlyOverRemoting extends Serializable
This interface indicates objects which areSerializable
only for sending over the RemotingChannel
. Usually it means that the object requires export of the class viaChannel
andhudson.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
All Methods Instance Methods Default Methods Modifier and Type Method Description default Channel
getChannelForSerialization()
Gets current channel or fails withNotSerializableException
.
-
-
-
Method Detail
-
getChannelForSerialization
@NonNull @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) default Channel getChannelForSerialization() throws NotSerializableException
Gets 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.
-
-