public abstract class NioChannelBuilder extends ChannelBuilder
ChannelBuilder
subtype for NioChannelHub
.NioChannelHub.newChannelBuilder(String, ExecutorService)
Modifier and Type | Method and Description |
---|---|
Channel |
build(SelectableChannel r,
SelectableChannel w) |
Channel |
build(Socket s) |
Channel |
build(SocketChannel socket) |
NioChannelBuilder |
withBaseLoader(ClassLoader base)
Specify the classloader used for deserializing remote commands.
|
NioChannelBuilder |
withCapability(Capability capability)
Controls the capabilities that we'll advertise to the other side.
|
NioChannelBuilder |
withHeaderStream(OutputStream header)
If non-null, receive the portion of data in is before
the data goes into the "binary mode".
|
NioChannelBuilder |
withJarCache(JarCache jarCache) |
NioChannelBuilder |
withMode(Channel.Mode mode)
The encoding to be used over the stream.
|
NioChannelBuilder |
withRestricted(boolean restricted)
If true, this channel won't accept
Command s that allow the remote end to execute arbitrary closures
--- instead they can only call methods on objects that are exported by this channel. |
build, build, getBaseLoader, getCapability, getExecutors, getHeaderStream, getJarCache, getMode, getName, isRestricted, makeTransport, negotiate
public Channel build(SocketChannel socket) throws IOException
build
in class ChannelBuilder
IOException
public Channel build(SelectableChannel r, SelectableChannel w) throws IOException
IOException
public Channel build(Socket s) throws IOException
build
in class ChannelBuilder
IOException
public NioChannelBuilder withBaseLoader(ClassLoader base)
ChannelBuilder
Channel.getRemoteProperty(Object)
. Sometimes two parties
communicate over a channel and pass objects around as properties, but those types might not be
visible from the classloader loading the Channel
class. In such a case, specify a classloader
so that those classes resolve. If null, Channel.class.getClassLoader()
is used.withBaseLoader
in class ChannelBuilder
public NioChannelBuilder withMode(Channel.Mode mode)
ChannelBuilder
withMode
in class ChannelBuilder
public NioChannelBuilder withCapability(Capability capability)
ChannelBuilder
withCapability
in class ChannelBuilder
public NioChannelBuilder withHeaderStream(OutputStream header)
ChannelBuilder
withHeaderStream
in class ChannelBuilder
public NioChannelBuilder withRestricted(boolean restricted)
ChannelBuilder
Command
s that allow the remote end to execute arbitrary closures
--- instead they can only call methods on objects that are exported by this channel.
This also prevents the remote end from loading classes into JVM.
Note that it still allows the remote end to deserialize arbitrary object graph
(provided that all the classes are already available in this JVM), so exactly how
safe the resulting behavior is is up to discussion.withRestricted
in class ChannelBuilder
public NioChannelBuilder withJarCache(JarCache jarCache)
withJarCache
in class ChannelBuilder
Copyright © 2014. All rights reserved.