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
Commands 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, negotiatepublic Channel build(SocketChannel socket) throws IOException
build in class ChannelBuilderIOExceptionpublic Channel build(SelectableChannel r, SelectableChannel w) throws IOException
IOExceptionpublic Channel build(Socket s) throws IOException
build in class ChannelBuilderIOExceptionpublic NioChannelBuilder withBaseLoader(ClassLoader base)
ChannelBuilderChannel.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 ChannelBuilderpublic NioChannelBuilder withMode(Channel.Mode mode)
ChannelBuilderwithMode in class ChannelBuilderpublic NioChannelBuilder withCapability(Capability capability)
ChannelBuilderwithCapability in class ChannelBuilderpublic NioChannelBuilder withHeaderStream(OutputStream header)
ChannelBuilderwithHeaderStream in class ChannelBuilderpublic NioChannelBuilder withRestricted(boolean restricted)
ChannelBuilderCommands 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 ChannelBuilderpublic NioChannelBuilder withJarCache(JarCache jarCache)
withJarCache in class ChannelBuilderCopyright © 2004-2014. All Rights Reserved.