|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.Computer
hudson.slaves.SlaveComputer
public class SlaveComputer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu |
|---|
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem |
| Field Summary |
|---|
| Fields inherited from class hudson.model.Computer |
|---|
CONFIGURE, CONNECT, CREATE, DELETE, DISCONNECT, nodeName, offlineCause, PERMISSIONS, statusChangeLock, threadPoolForRemoting, transientActions |
| Constructor Summary | |
|---|---|
SlaveComputer(Slave slave)
|
|
| Method Summary | |
|---|---|
protected Future<?> |
_connect(boolean forceReconnect)
Allows implementing-classes to provide an implementation for the connect method. |
Future<?> |
disconnect(OfflineCause cause)
Disconnect this computer. |
org.kohsuke.stapler.HttpResponse |
doDoDisconnect(String offlineMessage)
|
void |
doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
If Computer.getChannel()==null, attempts to relaunch the slave agent. |
void |
doSlaveAgentJnlp(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse res)
|
hudson.remoting.Channel |
getChannel()
Gets the channel that can be used to run a program on this computer. |
static hudson.remoting.VirtualChannel |
getChannelToMaster()
Obtains a VirtualChannel that allows some computation to be performed on the master. |
int |
getClassLoadingCount()
Shows Channel.classLoadingCount. |
long |
getClassLoadingTime()
Shows Channel.classLoadingTime. |
Charset |
getDefaultCharset()
Gets the default charset of this computer. |
String |
getIcon()
|
Slave.JnlpJar |
getJnlpJars(String fileName)
Deprecated. since 2008-08-18. This URL binding is no longer used and moved up directly under to Jenkins,
but it's left here for now just in case some old JNLP slave agents request it. |
String |
getJnlpMac()
|
ComputerLauncher |
getLauncher()
|
List<LogRecord> |
getLogRecords()
Gets the logs recorded by this slave. |
Slave |
getNode()
Returns the Node that this computer represents. |
String |
getOSDescription()
Get the OS description. |
int |
getResourceLoadingCount()
Shows Channel.resourceLoadingCount. |
long |
getResourceLoadingTime()
Shows Channel.resourceLoadingTime. |
RetentionStrategy |
getRetentionStrategy()
RetentionStrategy associated with this computer. |
String |
getSlaveVersion()
Get the slave version |
protected ComputerLauncher |
grabLauncher(Node node)
Grabs a ComputerLauncher out of Node to keep it in this Computer. |
boolean |
isAcceptingTasks()
Returns true if the computer is accepting tasks. |
boolean |
isConnecting()
Is a Computer.connect(boolean) operation in progress? |
boolean |
isJnlpAgent()
Deprecated. since 2008-05-20. |
boolean |
isLaunchSupported()
Returns true if this computer can be launched by Hudson proactively and automatically. |
Boolean |
isUnix()
True if this computer is a Unix machine (as opposed to Windows machine). |
protected void |
kill()
Called by Jenkins.updateComputerList() to notify Computer that it will be discarded. |
OutputStream |
openLogFile()
|
void |
setAcceptingTasks(boolean acceptingTasks)
Allows a ComputerLauncher or a RetentionStrategy to suspend tasks being accepted by the slave computer. |
void |
setChannel(hudson.remoting.Channel channel,
OutputStream launchLog,
hudson.remoting.Channel.Listener listener)
Sets up the connection through an exsting channel. |
void |
setChannel(InputStream in,
OutputStream out,
OutputStream launchLog,
hudson.remoting.Channel.Listener listener)
Creates a Channel from the given stream and sets that to this slave. |
void |
setChannel(InputStream in,
OutputStream out,
TaskListener taskListener,
hudson.remoting.Channel.Listener listener)
|
protected void |
setNode(Node node)
Called to notify Computer that its corresponding Node
configuration is updated. |
void |
taskAccepted(Executor executor,
Queue.Task task)
Called whenever a task is accepted by an executor. |
void |
taskCompleted(Executor executor,
Queue.Task task,
long durationMS)
Called whenever a task is completed without any problems by an executor. |
void |
taskCompletedWithProblems(Executor executor,
Queue.Task task,
long durationMS,
Throwable problems)
Called whenever a task is completed without any problems by an executor. |
void |
tryReconnect()
|
| Methods inherited from class hudson.model.Actionable |
|---|
doContextMenu, getAction, getAction, getActions, getDynamic |
| Methods inherited from class hudson.model.AbstractModelObject |
|---|
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SlaveComputer(Slave slave)
| Method Detail |
|---|
public boolean isAcceptingTasks()
true if the computer is accepting tasks. Needed to allow slaves programmatic suspension of task
scheduling that does not overlap with being offline.
isAcceptingTasks in class Computertrue if the computer is accepting taskspublic String getJnlpMac()
public void setAcceptingTasks(boolean acceptingTasks)
acceptingTasks - true if the slave can accept tasks.public Boolean isUnix()
public Slave getNode()
ComputerNode that this computer represents.
getNode in class ComputerComputer
is not yet gone.public String getIcon()
getIcon in class Computer@Deprecated public boolean isJnlpAgent()
Computer
isJnlpAgent in class Computerpublic boolean isLaunchSupported()
Computer
For example, JNLP slaves return false from this, because the launch process
needs to be initiated from the slave side.
isLaunchSupported in class Computerpublic ComputerLauncher getLauncher()
protected Future<?> _connect(boolean forceReconnect)
ComputerIf already connected or if this computer doesn't support proactive launching, no-op. This method may return immediately while the launch operation happens asynchronously.
_connect in class ComputerforceReconnect - If true and a connect activity is already in progress, it will be cancelled and
the new one will be started. If false, and a connect activity is already in progress, this method
will do nothing and just return the pending connection operation.
Future representing pending completion of the task. The 'completion' includes
both a successful completion and a non-successful completion (such distinction typically doesn't
make much sense because as soon as Computer is connected it can be disconnected by some other threads.)Computer.disconnect()
public void taskAccepted(Executor executor,
Queue.Task task)
taskAccepted in interface ExecutorListenertaskAccepted in class Computerexecutor - The executor.task - The task.
public void taskCompleted(Executor executor,
Queue.Task task,
long durationMS)
taskCompleted in interface ExecutorListenertaskCompleted in class Computerexecutor - The executor.task - The task.durationMS - The number of milliseconds that the task took to complete.
public void taskCompletedWithProblems(Executor executor,
Queue.Task task,
long durationMS,
Throwable problems)
taskCompletedWithProblems in interface ExecutorListenertaskCompletedWithProblems in class Computerexecutor - The executor.task - The task.durationMS - The number of milliseconds that the task took to complete.problems - The exception that was thrown.public boolean isConnecting()
ComputerComputer.connect(boolean) operation in progress?
isConnecting in class Computerpublic OutputStream openLogFile()
public void setChannel(InputStream in,
OutputStream out,
TaskListener taskListener,
hudson.remoting.Channel.Listener listener)
throws IOException,
InterruptedException
IOException
InterruptedException
public void setChannel(InputStream in,
OutputStream out,
OutputStream launchLog,
hudson.remoting.Channel.Listener listener)
throws IOException,
InterruptedException
Channel from the given stream and sets that to this slave.
in - Stream connected to the remote "slave.jar". It's the caller's responsibility to do
buffering on this stream, if that's necessary.out - Stream connected to the remote peer. It's the caller's responsibility to do
buffering on this stream, if that's necessary.launchLog - If non-null, receive the portion of data in is before
the data goes into the "binary mode". This is useful
when the established communication channel might include some data that might
be useful for debugging/trouble-shooting.listener - Gets a notification when the channel closes, to perform clean up. Can be null.
By the time this method is called, the cause of the termination is reported to the user,
so the implementation of the listener doesn't need to do that again.
IOException
InterruptedException
public int getClassLoadingCount()
throws IOException,
InterruptedException
Channel.classLoadingCount.
IOException
InterruptedException
public int getResourceLoadingCount()
throws IOException,
InterruptedException
Channel.resourceLoadingCount.
IOException
InterruptedException
public long getClassLoadingTime()
throws IOException,
InterruptedException
Channel.classLoadingTime.
IOException
InterruptedException
public long getResourceLoadingTime()
throws IOException,
InterruptedException
Channel.resourceLoadingTime.
IOException
InterruptedException
public void setChannel(hudson.remoting.Channel channel,
OutputStream launchLog,
hudson.remoting.Channel.Listener listener)
throws IOException,
InterruptedException
IOException
InterruptedExceptionpublic hudson.remoting.Channel getChannel()
Computer
getChannel in class ComputerComputer.isOffline()==false.public Charset getDefaultCharset()
Computer
getDefaultCharset in class ComputerComputer.isOffline()==false.
public List<LogRecord> getLogRecords()
throws IOException,
InterruptedException
Computer
getLogRecords in class ComputerIOException
InterruptedException
public org.kohsuke.stapler.HttpResponse doDoDisconnect(@QueryParameter
String offlineMessage)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletExceptionpublic Future<?> disconnect(OfflineCause cause)
Computer
disconnect in class Computercause - Object that identifies the reason the node was disconnected.
Future to track the asynchronous disconnect operation.Computer.connect(boolean)
public void doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
ComputerComputer.getChannel()==null, attempts to relaunch the slave agent.
doLaunchSlaveAgent in class ComputerIOException
javax.servlet.ServletExceptionpublic void tryReconnect()
public Slave.JnlpJar getJnlpJars(String fileName)
Jenkins,
but it's left here for now just in case some old JNLP slave agents request it.
@WebMethod(name="slave-agent.jnlp")
public void doSlaveAgentJnlp(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse res)
throws IOException,
javax.servlet.ServletException
IOException
javax.servlet.ServletExceptionprotected void kill()
ComputerJenkins.updateComputerList() to notify Computer that it will be discarded.
Note that at this point Computer.getNode() returns null.
kill in class ComputerComputer.onRemoved()public RetentionStrategy getRetentionStrategy()
ComputerRetentionStrategy associated with this computer.
getRetentionStrategy in class ComputerRetentionStrategy<? super T> where
T=this.getClass().protected void setNode(Node node)
ComputerComputer that its corresponding Node
configuration is updated.
setNode in class Computerprotected ComputerLauncher grabLauncher(Node node)
ComputerLauncher out of Node to keep it in this Computer.
The returned launcher will be set to launcher and used to carry out the actual launch operation.
Subtypes that needs to decorate ComputerLauncher can do so by overriding this method.
This is useful for SlaveComputers for clouds for example, where one normally needs
additional pre-launch step (such as waiting for the provisioned node to become available)
before the user specified launch step (like SSH connection) kicks in.
ComputerLauncherFilter
public String getSlaveVersion()
throws IOException,
InterruptedException
IOException
InterruptedException
public String getOSDescription()
throws IOException,
InterruptedException
IOException
InterruptedExceptionpublic static hudson.remoting.VirtualChannel getChannelToMaster()
VirtualChannel that allows some computation to be performed on the master.
This method can be called from any thread on the master, or from slave (more precisely,
it only works from the remoting request-handling thread in slaves, which means if you've started
separate thread on slaves, that'll fail.)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||