Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from ndeloof/JENKINS-21746
introduce TcpSocketHostLocator extension point
- Loading branch information
Showing
3 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package hudson.maven; | ||
|
||
import hudson.ExtensionList; | ||
import hudson.ExtensionPoint; | ||
import jenkins.model.Jenkins; | ||
|
||
import javax.annotation.CheckForNull; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
/** | ||
* Identify the Host name to use from maven-agent to connect to to jenkins slave agent TCP socket. | ||
* <p> | ||
* In simple scenarios both slave agent and maven process do live on same host without specific network | ||
* constraints, but for some virtualization usages maven process just can't bind a socket on wildcard | ||
* host network. This extension give infrastructure plugins a chance to configure the adequate hostname. | ||
* to handle such network constraints | ||
* | ||
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a> | ||
*/ | ||
public abstract class TcpSocketHostLocator implements ExtensionPoint { | ||
|
||
/** | ||
* Try to identify the slave agent TCP socket host name or IP. | ||
* @return <code>null</code> if not found or does not apply to this specific implementation | ||
* @throws IOException | ||
*/ | ||
public abstract @CheckForNull String getTcpSocketHost() throws IOException; | ||
|
||
public static List<TcpSocketHostLocator> all() { | ||
return ExtensionList.lookup(TcpSocketHostLocator.class); | ||
} | ||
|
||
} |