A channel can be created in two ways: an instance of a subclass of Channel is created directly using its public constructor (e.g. JChannel), or a channel factory is created, which - upon request - creates instances of channels. We will only look at the first method of creating channel: by direct instantiation. Note that instantiation may differ between the various channel implementations. As example we will look at JChannel (JavaGroups.JChannel).
The public constructor of JChannel looks as follows:
public JChannel(Object properties) throws ChannelException {}
It creates an instance of JChannel. The argument defines the composition of the protocol stack (number and type of layers, parameters for each layer, and their order). If it is null, the default properties will be used. An exception will be thrown if the channel cannot be created. Possible causes include protocols that were specified in the property argument, but were not found, or wrong parameters to protocols. (Refer to 4 for more information).