jenkins.model
Class Jenkins.MasterComputer

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Computer
              extended by jenkins.model.Jenkins.MasterComputer
All Implemented Interfaces:
ExecutorListener, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu
Direct Known Subclasses:
Hudson.MasterComputer
Enclosing class:
Jenkins

public static class Jenkins.MasterComputer
extends Computer


Nested Class Summary
 
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem
 
Field Summary
static hudson.remoting.LocalChannel localChannel
          LocalChannel instance that can be used to execute programs locally.
 
Fields inherited from class hudson.model.Computer
CONFIGURE, CONNECT, CREATE, DELETE, DISCONNECT, nodeName, offlineCause, PERMISSIONS, statusChangeLock, threadPoolForRemoting, transientActions
 
Constructor Summary
protected Jenkins.MasterComputer()
           
 
Method Summary
protected  Future<?> _connect(boolean forceReconnect)
          Allows implementing-classes to provide an implementation for the connect method.
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Accepts the update to the node configuration.
 org.kohsuke.stapler.HttpResponse doDoDelete()
          Report an error.
 void doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          If Computer.getChannel()==null, attempts to relaunch the slave agent.
 String getCaption()
           
 hudson.remoting.VirtualChannel getChannel()
          Gets the channel that can be used to run a program on this computer.
 Charset getDefaultCharset()
          Gets the default charset of this computer.
 String getDisplayName()
           
 List<LogRecord> getLogRecords()
          Gets the logs recorded by this slave.
 String getName()
          Returns "" to match with AbstractCIBase.getNodeName().
 RetentionStrategy getRetentionStrategy()
          RetentionStrategy associated with this computer.
 String getUrl()
           
 boolean hasPermission(Permission permission)
          Convenient short-cut for getACL().hasPermission(permission)
protected  boolean isAlive()
          Will always keep this guy alive so that it can function as a fallback to execute Queue.FlyweightTasks.
 boolean isConnecting()
          Is a Computer.connect(boolean) operation in progress?
 
Methods inherited from class hudson.model.Computer
_doScript, addAction, buildEnvironment, checkPermission, cliConnect, cliDisconnect, cliOffline, cliOnline, connect, countBusy, countExecutors, countIdle, currentComputer, disconnect, disconnect, doChangeOfflineCause, doConfigDotXml, doDumpExportTable, doProgressiveLog, doRssAll, doRssFailed, doScript, doScriptText, doToggleOffline, getACL, getActions, getApi, getBuilds, getComputerPanelBoxs, getConnectTime, getDemandStartMilliseconds, getEnvironment, getEnvVars, getExecutors, getHeapDump, getHostName, getIcon, getIconAltText, getIdleStartMilliseconds, getLoadStatistics, getLog, getLogFile, getLogText, getMonitorData, getNode, getNumExecutors, getOfflineCause, getOfflineCauseReason, getOneOffExecutors, getSearchUrl, getSystemProperties, getThreadDump, getTiedJobs, getTimeline, getWorkspaceList, interrupt, isAcceptingTasks, isIdle, isJnlpAgent, isLaunchSupported, isManualLaunchAllowed, isOffline, isOnline, isPartiallyIdle, isTemporarilyOffline, kill, launch, onRemoved, relocateOldLogs, resolveForCLI, setNode, setTemporarilyOffline, setTemporarilyOffline, taskAccepted, taskCompleted, taskCompletedWithProblems, waitUntilOffline, waitUntilOnline
 
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
 

Field Detail

localChannel

public static final hudson.remoting.LocalChannel localChannel
LocalChannel instance that can be used to execute programs locally.

Constructor Detail

Jenkins.MasterComputer

protected Jenkins.MasterComputer()
Method Detail

getName

public String getName()
Returns "" to match with AbstractCIBase.getNodeName().

Overrides:
getName in class Computer

isConnecting

public boolean isConnecting()
Description copied from class: Computer
Is a Computer.connect(boolean) operation in progress?

Specified by:
isConnecting in class Computer

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface ModelObject
Overrides:
getDisplayName in class Computer

getCaption

public String getCaption()
Overrides:
getCaption in class Computer

getUrl

public String getUrl()
Overrides:
getUrl in class Computer

getRetentionStrategy

public RetentionStrategy getRetentionStrategy()
Description copied from class: Computer
RetentionStrategy associated with this computer.

Specified by:
getRetentionStrategy in class Computer
Returns:
never null. This method return RetentionStrategy<? super T> where T=this.getClass().

isAlive

protected boolean isAlive()
Will always keep this guy alive so that it can function as a fallback to execute Queue.FlyweightTasks. See JENKINS-7291.

Overrides:
isAlive in class Computer

doDoDelete

public org.kohsuke.stapler.HttpResponse doDoDelete()
                                            throws IOException
Report an error.

Overrides:
doDoDelete in class Computer
Throws:
IOException

doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws IOException,
                           javax.servlet.ServletException,
                           Descriptor.FormException
Description copied from class: Computer
Accepts the update to the node configuration.

Overrides:
doConfigSubmit in class Computer
Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

hasPermission

public boolean hasPermission(Permission permission)
Description copied from interface: AccessControlled
Convenient short-cut for getACL().hasPermission(permission)

Specified by:
hasPermission in interface AccessControlled
Overrides:
hasPermission in class Computer

getChannel

public hudson.remoting.VirtualChannel getChannel()
Description copied from class: Computer
Gets the channel that can be used to run a program on this computer.

Specified by:
getChannel in class Computer
Returns:
never null when Computer.isOffline()==false.

getDefaultCharset

public Charset getDefaultCharset()
Description copied from class: Computer
Gets the default charset of this computer.

Specified by:
getDefaultCharset in class Computer
Returns:
never null when Computer.isOffline()==false.

getLogRecords

public List<LogRecord> getLogRecords()
                              throws IOException,
                                     InterruptedException
Description copied from class: Computer
Gets the logs recorded by this slave.

Specified by:
getLogRecords in class Computer
Throws:
IOException
InterruptedException

doLaunchSlaveAgent

public void doLaunchSlaveAgent(org.kohsuke.stapler.StaplerRequest req,
                               org.kohsuke.stapler.StaplerResponse rsp)
                        throws IOException,
                               javax.servlet.ServletException
Description copied from class: Computer
If Computer.getChannel()==null, attempts to relaunch the slave agent.

Specified by:
doLaunchSlaveAgent in class Computer
Throws:
IOException
javax.servlet.ServletException

_connect

protected Future<?> _connect(boolean forceReconnect)
Description copied from class: Computer
Allows implementing-classes to provide an implementation for the connect method.

If already connected or if this computer doesn't support proactive launching, no-op. This method may return immediately while the launch operation happens asynchronously.

Specified by:
_connect in class Computer
Parameters:
forceReconnect - 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.
Returns:
A 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.)
See Also:
Computer.disconnect()


Copyright © 2004-2013. All Rights Reserved.