|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.link.LnkObject
com.neeve.link.LnkContainer
com.neeve.link.LnkSTRContainer
public class LnkSTRContainer
Collection of link trees grouped by the STR threading model.
An STR link container serves as a collection of link trees that support the
STR (single threaded read) read threading model and whose read machinery are
powered by a single reader thread. The container maintains knowledge of the
reader thread (in the form of an EMX dispatcher) but does not provide the
machinery by which the thread (dispatcher) is run. It interacts with root
endpoints of the contained link trees using ILnkSTRRootEndpoint
through which it starts and stops the read of the contained link trees.
This link container is compatible with link trees whose root endpoints
implement the ILnkSTRRootEndpoint
interface.
Field Summary |
---|
Fields inherited from class com.neeve.link.LnkContainer |
---|
RMFLG_ALLOW_READ_OPERATIONAL |
Method Summary | |
---|---|
static LnkSTRContainer |
createTemporary(RootConfig.ObjectConfig config,
IEmxDispatcher reader)
Create a temporary STR container. |
IEmxDispatcher |
getCurrentReader()
Implementation of LnkContainer.getCurrentReader() |
IEmxDispatcher |
getReader()
Get the reader thread. |
boolean |
isCompatible(ILnkPeerEndpoint pep)
Implementation of LnkContainer.isCompatible(com.neeve.link.ILnkPeerEndpoint) . |
void |
startRead(ILnkPeerEndpoint pep)
Implementation of LnkContainer.startRead(com.neeve.link.ILnkPeerEndpoint) |
void |
stopRead(ILnkPeerEndpoint pep)
Implementation of LnkContainer.stopRead(com.neeve.link.ILnkPeerEndpoint) |
String |
toString()
Get a string representation of this link container |
Methods inherited from class com.neeve.link.LnkContainer |
---|
getCount, getLink, getLinks, getName, touch, touch |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static LnkSTRContainer createTemporary(RootConfig.ObjectConfig config, IEmxDispatcher reader)
config
- The package configuration object to use in the creation
of this container. The allows the parameters used to configure the
package that is using this class to be automatically applied to this
object too. A null value will cause the container to use its default
config object.reader
- The thread (the owner of the specified EMX dispatcher) to
be associated with the temporary container as the reader thread. A value
of null indicates that no reader thread is to be associated with the
temporary container at this time. In that case, the reader thread should
be set at a later point via setReader(com.neeve.emx.IEmxDispatcher)
before any of the other
methods are invoked.
This is a utility method that creates an STR link container for temporary use. The method uses a UUID to obtain the name of the container. It creates the container using the specified dispatcher as the container reader.
public final IEmxDispatcher getReader()
public final boolean isCompatible(ILnkPeerEndpoint pep)
LnkContainer.isCompatible(com.neeve.link.ILnkPeerEndpoint)
.
This method validate that the root endpoint of the link tree of the specified link implements ILnkSTRRootEndpoint.
isCompatible
in class LnkContainer
pep
- The link whose associated compatibility is to be tested.
This method tests compatibility between a link and a container. A link
is considered to be compatible with a container if the root endpoint of
the link's tree supports the appropriate derivative of ILnkRootEndpoint
that the container understands and works with.
public final void startRead(ILnkPeerEndpoint pep) throws ELnkNotPresentException, ELnkReadOperationalException, ELnkNotCompatibleException, ELnkException
LnkContainer.startRead(com.neeve.link.ILnkPeerEndpoint)
startRead
in class LnkContainer
pep
- The peer endpoint of a link in the link tree whose read
machinery is to be started.
ELnkNotPresentException
- Thrown in case the link is associated
with some container and that container is different from this
one.
ELnkReadOperationalException
- Thrown in case the read on the
spcified link tree is already operational.
ELnkNotCompatibleException
- Thrown in case the link on which the
user is starting the read is incomptible with this container. This
exception is never thrown in case the link in contained by this
container.
ELnkException
- Thrown in case an error was encountered while
starting the read on the link.
This method associates the containers threads with the read machinery of the link tree of the specified link. A successful invocation of this method will cause the running of the container's threads' dispatchers to drive the receipt of packets and events through the specified link tree.
LnkContainer.stopRead(com.neeve.link.ILnkPeerEndpoint)
public final IEmxDispatcher getCurrentReader()
LnkContainer.getCurrentReader()
getCurrentReader
in class LnkContainer
public final void stopRead(ILnkPeerEndpoint pep) throws ELnkNotPresentException, ELnkNotCompatibleException, ELnkException
LnkContainer.stopRead(com.neeve.link.ILnkPeerEndpoint)
stopRead
in class LnkContainer
ELnkNotPresentException
- Thrown in case the link is associated
with some container and that container is different from this one.
ELnkNotCompatibleException
- Thrown in case the link on which the
user is stopping the read is incomptible with this container. This
exception is never thrown in case the link in contained by this container.
ELnkException
- Thrown in case an error was encountered while
starting the read on the link.
This method disassociates the threads managed by the link container from the read machinery of the specified link tree. Once this method returns successfully, the running of the container's threads' dispatchers will have no effect on the receipt of packets and events through the link tree. This method can be safely invoked for a link tree whose read has not been started. In that case, the method will do nothing and just return.
LnkContainer.startRead(com.neeve.link.ILnkPeerEndpoint)
public String toString()
toString
in class LnkContainer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |