|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ChannelFactory
The main interface to a transport that creates a Channel
associated
with a certain communication entity such as a network socket. For example,
the NioServerSocketChannelFactory
creates a channel which has a
NIO-based server socket as its underlying communication entity.
Once a new Channel
is created, the ChannelPipeline
which
was specified as a parameter in the newChannel(ChannelPipeline)
is attached to the new Channel
, and starts to handle all associated
ChannelEvent
s.
To shut down a network application service which is managed by a factory. you should follow the following steps:
ChannelGroup.close()
, andreleaseExternalResources()
.
For detailed transport-specific information on shutting down a factory,
please refer to the Javadoc of ChannelFactory
's subtypes, such as
NioServerSocketChannelFactory
.
Method Summary | |
---|---|
Channel |
newChannel(ChannelPipeline pipeline)
Creates and opens a new Channel and attaches the specified
ChannelPipeline to the new Channel . |
void |
releaseExternalResources()
Releases the external resources that this factory depends on to function. |
Method Detail |
---|
Channel newChannel(ChannelPipeline pipeline)
Channel
and attaches the specified
ChannelPipeline
to the new Channel
.
pipeline
- the ChannelPipeline
which is going to be
attached to the new Channel
ChannelException
- if failed to create and open a new channelvoid releaseExternalResources()
Executor
s that you specified in the factory
constructor are external resources. You can call this method to release
all external resources conveniently when the resources are not used by
this factory or any other part of your application. An unexpected
behavior will be resulted in if the resources are released when there's
an open channel which is managed by this factory.
releaseExternalResources
in interface ExternalResourceReleasable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |