public final class ProtocolCollection extends java.lang.Object implements java.lang.Iterable<ProtocolDescriptor>
In general use getDefaultCollection()
to retrieve
the default collection.
Modifier and Type | Method and Description |
---|---|
static ProtocolCollection |
create(ProtocolDescriptor... descriptors)
Creates a ProtocolCollection with the specified ProtocolDescriptors.
|
static ProtocolCollection |
getDefaultCollection()
Returns the default ProtocolCollection.
|
int |
getProtocolCount() |
ProtocolDescriptor |
getProtocolDescriptor(int protocolVersion) |
java.util.List<java.lang.Integer> |
getProtocolVersions()
Get a list with the protocol versions in this collection.
|
java.util.Iterator<ProtocolDescriptor> |
iterator() |
public java.util.Iterator<ProtocolDescriptor> iterator()
iterator
in interface java.lang.Iterable<ProtocolDescriptor>
public ProtocolDescriptor getProtocolDescriptor(int protocolVersion)
protocolVersion
- Version of the protocolpublic int getProtocolCount()
public java.util.List<java.lang.Integer> getProtocolVersions()
The returned List is created fresh on every call. Changes to the list have no effect on this object.
public static ProtocolCollection create(ProtocolDescriptor... descriptors)
If descriptors
contains multiple implementations with the
same value for ProtocolDescriptor.getVersion()
, then the first
implementation with the highest value for
ProtocolDescriptor.getWeight()
will be loaded into the
collection.
descriptors
- Vararg parameter with ProtocolDescriptorspublic static ProtocolCollection getDefaultCollection()
The default ProtocolCollection is created when this class is loaded by the classloader.
This implementation uses the ServiceLoader
to load the default
collection based on all ProtocolDescriptor
implementations found
using all the
/META-INF/services/org.firebirdsql.gds.ng.wire.ProtocolDescriptor
in the classpath. If multiple implementations with the same value for
ProtocolDescriptor.getVersion()
are found, then the first
implementation with the highest value for
ProtocolDescriptor.getWeight()
will be loaded into the default
collection.
create(ProtocolDescriptor...)
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.