Package org.jenkinsci.remoting.engine
Class JnlpConnectionStateListener
- java.lang.Object
-
- org.jenkinsci.remoting.engine.JnlpConnectionStateListener
-
public abstract class JnlpConnectionStateListener extends Object
A listener for connection state changes. The listeners will be called in order for any unique event. UseJnlpConnectionState.setStash(JnlpConnectionState.ListenerState)
andJnlpConnectionState.getStash(Class)
if you need to maintain state between callbacks.beforeProperties(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)afterProperties(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)beforeChannel(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)afterChannel(JnlpConnectionState)
(if closed thenchannelClosed(JnlpConnectionState)
)channelClosed(JnlpConnectionState)
afterDisconnect(JnlpConnectionState)
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description JnlpConnectionStateListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
afterChannel(JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been created and is available viaJnlpConnectionState.getChannel()
.void
afterDisconnect(JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theSocket
has been closed.abstract void
afterProperties(JnlpConnectionState event)
Notification that properties have been exchanged.void
beforeChannel(JnlpConnectionState event)
Callback to allow theJnlpConnectionState.approve()
listener to decorate theChannelBuilder
viaJnlpConnectionState.getChannelBuilder()
.void
beforeProperties(JnlpConnectionState event)
Notification that the connection has been established and properties will be exchanged.void
channelClosed(JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been closed.
-
-
-
Method Detail
-
beforeProperties
public void beforeProperties(@NonNull JnlpConnectionState event)
Notification that the connection has been established and properties will be exchanged. CallJnlpConnectionState.ignore()
to suppress any further notifications of this event. CallJnlpConnectionState.reject(ConnectionRefusalException)
to reject the connection. CallJnlpConnectionState.approve()
to declare ownership of this event (normally better to defer this toafterProperties(JnlpConnectionState)
)- Parameters:
event
- the event.
-
afterProperties
public abstract void afterProperties(@NonNull JnlpConnectionState event)
Notification that properties have been exchanged. CallJnlpConnectionState.ignore()
to suppress any further notifications of this event. CallJnlpConnectionState.reject(ConnectionRefusalException)
to reject the connection. CallJnlpConnectionState.approve()
to declare ownership of this event.- Parameters:
event
- the event.
-
beforeChannel
public void beforeChannel(@NonNull JnlpConnectionState event)
Callback to allow theJnlpConnectionState.approve()
listener to decorate theChannelBuilder
viaJnlpConnectionState.getChannelBuilder()
.- Parameters:
event
- the event.
-
afterChannel
public abstract void afterChannel(@NonNull JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been created and is available viaJnlpConnectionState.getChannel()
.- Parameters:
event
- the event.
-
channelClosed
public void channelClosed(@NonNull JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been closed.- Parameters:
event
- the event.
-
afterDisconnect
public void afterDisconnect(@NonNull JnlpConnectionState event)
Callback to notify theJnlpConnectionState.approve()
listener that theSocket
has been closed.- Parameters:
event
- the event.
-
-