|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.slaves.ComputerListener
public abstract class ComputerListener
Receives notifications about status changes of Computer
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Constructor Summary | |
---|---|
ComputerListener()
|
Method Summary | |
---|---|
static ExtensionList<ComputerListener> |
all()
All the registered ComputerListener s. |
void |
onConfigurationChange()
Called when configuration of the node was changed, a node is added/removed, etc. |
void |
onLaunchFailure(Computer c,
TaskListener taskListener)
Called when a slave attempted to connect via ComputerLauncher but it failed. |
void |
onOffline(Computer c)
Called right after a Computer went offline. |
void |
onOnline(Computer c)
Deprecated. as of 1.292 Use onOnline(Computer, TaskListener) |
void |
onOnline(Computer c,
TaskListener listener)
Called right after a Computer comes online. |
void |
onTemporarilyOffline(Computer c,
OfflineCause cause)
Indicates that the computer was marked as temporarily online by the administrator. |
void |
onTemporarilyOnline(Computer c)
Indicates that the computer was marked as temporarily online by the administrator. |
void |
preLaunch(Computer c,
TaskListener taskListener)
Called before a ComputerLauncher is asked to launch a connection with Computer . |
void |
preOnline(Computer c,
hudson.remoting.Channel channel,
FilePath root,
TaskListener listener)
Called before a Computer is marked online. |
void |
register()
Deprecated. as of 1.286 put Extension on your class to have it auto-registered. |
boolean |
unregister()
Unregisters this ComputerListener so that it will never receive further events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComputerListener()
Method Detail |
---|
public void preLaunch(Computer c, TaskListener taskListener) throws IOException, InterruptedException
ComputerLauncher
is asked to launch a connection with Computer
.
This enables you to do some configurable checks to see if we want to bring this slave online or if there are considerations that would keep us from doing so.
Throwing AbortException
would let you veto the launch operation. Other thrown exceptions
will also have the same effect, but their stack trace will be dumped, so they are meant for error situation.
c
- Computer that's being launched. Never null.taskListener
- Connected to the slave console log. Useful for reporting progress/errors on a lengthy operation.
Never null.
AbortException
- Exceptions will be recorded to the listener, and
the computer will not become online.
IOException
InterruptedException
public void onLaunchFailure(Computer c, TaskListener taskListener) throws IOException, InterruptedException
ComputerLauncher
but it failed.
c
- Computer that was trying to launch. Never null.taskListener
- Connected to the slave console log. Useful for reporting progress/errors on a lengthy operation.
Never null.
IOException
InterruptedException
public void preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) throws IOException, InterruptedException
Computer
is marked online.
This enables you to do some work on all the slaves
as they get connected. Unlike onOnline(Computer, TaskListener)
,
a failure to carry out this function normally will prevent
a computer from marked as online.
channel
- This is the channel object to talk to the slave.
(This is the same object returned by Computer.getChannel()
once
it's connected.root
- The directory where this slave stores files.
The same as Node.getRootPath()
, except that method returns
null until the slave is connected. So this parameter is passed explicitly instead.listener
- This is connected to the launch log of the computer.
Since this method is called synchronously from the thread
that launches a computer, if this method performs a time-consuming
operation, this listener should be notified of the progress.
This is also a good listener for reporting problems.
IOException
- Exceptions will be recorded to the listener, and
the computer will not become online.
InterruptedException
- Exceptions will be recorded to the listener, and
the computer will not become online.onOnline(Computer, TaskListener)
public void onOnline(Computer c)
onOnline(Computer, TaskListener)
Computer
comes online.
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException
Computer
comes online.
This enables you to do some work on all the slaves as they get connected.
Starting Hudson 1.312, this method is also invoked for the master, not just for slaves.
listener
- This is connected to the launch log of the computer.
Since this method is called synchronously from the thread
that launches a computer, if this method performs a time-consuming
operation, this listener should be notified of the progress.
This is also a good listener for reporting problems.
IOException
- Exceptions will be recorded to the listener. Note that
throwing an exception doesn't put the computer offline.
InterruptedException
- Exceptions will be recorded to the listener. Note that
throwing an exception doesn't put the computer offline.preOnline(Computer, Channel, FilePath, TaskListener)
public void onOffline(Computer c)
Computer
went offline.
public void onTemporarilyOnline(Computer c)
#onTemporarilyOffline(Computer)
public void onTemporarilyOffline(Computer c, OfflineCause cause)
#onTemporarilyOffline(Computer)
public void onConfigurationChange()
This callback is to signal when there's any change to the list of slaves registered to the system, including addition, removal, changing of the setting, and so on.
public final void register()
Extension
on your class to have it auto-registered.
ComputerListener
so that it will start receiving events.
public final boolean unregister()
ComputerListener
so that it will never receive further events.
Unless ComputerListener
is unregistered, it will never be a subject of GC.
public static ExtensionList<ComputerListener> all()
ComputerListener
s.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |