Skip to content
Permalink
Browse files

[JENKINS-51551] Allow CommandTransport and its sub-classes to be sub-…

…typed from outside (#272)

* Change some CommandTransport methods from package-private to protected

* Change read() and write() access to public

* Make fields public to implement remoting-kafka-agent
  • Loading branch information...
pvtuan10 authored and oleg-nenashev committed Jun 7, 2018
1 parent cc7778e commit bed0a07a1b62ffa195ce330a35906f098e7b1e51
@@ -49,17 +49,15 @@
* @since 2.13
*/
public abstract class CommandTransport {
/**
* Package private so as not to allow direct subtyping (just yet.)
*/
/*package*/ CommandTransport() {

protected CommandTransport() {
}

/**
* SPI implemented by {@link Channel} so that the transport can pass the received command
* to {@link Channel} for processing.
*/
static interface CommandReceiver {
protected static interface CommandReceiver {
/**
* Notifies the channel that a new {@link Command} was received from the other side.
*
@@ -142,7 +140,7 @@
* Informational flag that indicates that this is the last
* call of the {@link #write(Command, boolean)}.
*/
abstract void write(Command cmd, boolean last) throws IOException;
public abstract void write(Command cmd, boolean last) throws IOException;

/**
* Called to close the write side of the transport, allowing the underlying transport
@@ -24,7 +24,7 @@
/**
* Default JAR cache location for disabled workspace Manager.
*/
/*package*/ static final File DEFAULT_NOWS_JAR_CACHE_LOCATION =
public static final File DEFAULT_NOWS_JAR_CACHE_LOCATION =
new File(System.getProperty("user.home"),".jenkins/cache/jars");

//TODO: replace by checked exception
@@ -31,7 +31,7 @@
/**
* Called by {@link Channel} to read the next command to arrive from the stream.
*/
abstract Command read() throws IOException, ClassNotFoundException, InterruptedException;
public abstract Command read() throws IOException, ClassNotFoundException, InterruptedException;

@Override
public void setup(Channel channel, CommandReceiver receiver) {

0 comments on commit bed0a07

Please sign in to comment.
You can’t perform that action at this time.