public interface PortFactoryInterface
PortFactoryManager.getFactory(name, Object);
.
This also indicates that the factory is in use and should not be removed/released by adding a reference to the
factory. getFactory(Object)
must be called exactly once. Attempts to call it a second time
with the same arguments will throw. After obtaining a factory, a PortPool can be obtained from the factory using
the getPortPool
method.
Once a port pool is obtained, then the checkout();
,
checkin(PortInterface);
methods can be called. checkout();
gets
access to one of the underlying ports. If the port cannot be opened or if there is any other error, this method
will throw. Otherwise, this method will wait until a port is available (or for a component specific
timeout). If a port is unavailable after that timeout, then this method will throw. Once a port has been
successfully checked out, the port may be used exclusively until it is checked in. The port is checked in with
the checkin(PortInterface);
method of the PortPoolInterface. Once checked in, the port should no
longer be used. When the port is no longer required, the reference to the pool should be release with a call to
releasePortPool(String, Object);
in the PortFactoryInterface. The arguments should be the same as used
when adding the reference and the method will throw if the get method has not been called with this argument.
Once the factory is no longer required, the
releaseFactory
method of the PortFactoryManager
should be called so that the resource can be freed.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the name of the factory.
|
PortPoolInterface |
getPortPool(java.lang.String portName,
java.lang.Object checkedForDuplication)
Returns a pool for a particular port.
|
void |
releasePortPool(PortPoolInterface portPool,
java.lang.Object mustHaveBeenAdded)
Removes a reference to a particular port name.
|
static final java.lang.String cvsRev
java.lang.String getName()
PortPoolInterface getPortPool(java.lang.String portName, java.lang.Object checkedForDuplication) throws java.io.IOException, BadParameterException
releasePortPool
method.portName
- the name of the port for which a pool is requested. The format of the name is dependent upon the
implementation.checkedForDuplication
- if this method is called more than once with identical arguments then a
BadParameterException is thrownjava.io.IOException
- thrown if thrown when creating a port pool/portBadParameterException
- thrown if thrown when creating a port pool/port or this method is called twice with identical argumentsvoid releasePortPool(PortPoolInterface portPool, java.lang.Object mustHaveBeenAdded) throws java.io.IOException, BadParameterException
string
- java.io.IOException
BadParameterException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.