com.neeve.link
Class LnkPeerEndpoint

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.link.LnkObject
          extended by com.neeve.link.LnkPeerEndpoint
All Implemented Interfaces:
ILnkEndpoint, ILnkPeerEndpoint

public final class LnkPeerEndpoint
extends LnkObject
implements ILnkPeerEndpoint

Peer endpoint class.

This class implements the ILnkPeerEndpoint interface. Internally, this class implements a portion that is common to all peer endpoint implementations and a portion that is link type specific. The class abstracts link type specific implementations via the ILnkPeerEndpointCore interface. At endpoint creation time, link type specific implementations wrap an instance of this class around the actual implementation and return the wrapped class to the user as ILnkPeerEndpoint.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.neeve.link.ILnkPeerEndpoint
ILnkPeerEndpoint.AsynchronousFlushContext, ILnkPeerEndpoint.FlushContext, ILnkPeerEndpoint.State, ILnkPeerEndpoint.SynchronousBlockingFlushContext, ILnkPeerEndpoint.SynchronousNonBlockingFlushContext
 
Field Summary
 
Fields inherited from interface com.neeve.link.ILnkEndpoint
IOFLAG_FLUSH_FORCE, IOFLAG_FLUSH_SUPPRESS, IOFLAG_IMMEDIATE_DISPATCH, IOFLAG_NO_ASYNC, LVFLAG_ALLOW_FLUSH_PENDING, LVFLAG_SUPPRESS_IMPLICT_CLOSE
 
Method Summary
 void close(short ltp)
          Implementation of ILnkPeerEndpoint.close(short)
static ILnkPeerEndpoint create(RootConfig.ObjectConfig config, ILnkPeerEndpointCore pep, HashMap<String,Object> props, String type)
          Create a link peer endpoint.
 boolean enque(short ltp, PktPacket packet, ILnkPeerEndpoint.FlushContext flushContext, int flags)
          Implementation of ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int)
 void fail(Exception e)
          Implementation of ILnkPeerEndpoint.fail(java.lang.Exception)
 void flush(short ltp, ILnkPeerEndpoint.FlushContext flushContext)
          Implementation of ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext)
 Object getAttachment()
          Implementation of ILnkPeerEndpoint.getAttachment()
 LnkContainer getContainer()
          Implementation of ILnkPeerEndpoint.getContainer()
 int getEnqueuedSize()
          Implementation of ILnkPeerEndpoint.getEnqueuedSize()
 ILnkPeerEndpoint.EventHandlerChain getHandlerChain()
          Implementation of ILnkPeerEndpoint.getHandlerChain()
 short getLtp()
          Implementation of ILnkPeerEndpoint.getLtp()
 String getName()
          Implementation of ILnkPeerEndpoint.getName()
 String getNameInternal()
          Implementation of ILnkPeerEndpoint.getNameInternal()
 long getNextSequenceNum()
          Implementation of ILnkPeerEndpoint.getNextSequenceNum()
 ILnkRootEndpoint getRootEndpoint()
          Implementation of ILnkPeerEndpoint.getRootEndpoint()
 ILnkPeerEndpoint.State getState()
          Implementation of ILnkPeerEndpoint.getState()
 String getType()
          Implementation of ILnkPeerEndpoint.getType()
 Date getWhenCreated()
          Implementation of ILnkPeerEndpoint.getWhenCreated()
 boolean isGroupEndpoint()
          Implementation of ILnkPeerEndpoint.isGroupEndpoint()
 boolean isJoined(short ltp)
          Implementation of ILnkPeerEndpoint.isJoined(short)
 boolean isReadOperational()
          Implementation of ILnkPeerEndpoint.isReadOperational()
 boolean isRootEndpoint()
          Implementation of ILnkPeerEndpoint.isRootEndpoint()
 void join(short ltp, ILnkEventHandler handler)
          Implementation of ILnkPeerEndpoint.join(short, com.neeve.link.ILnkEventHandler)
 void leave(short ltp, int flags)
          Implementation of ILnkPeerEndpoint.leave(short, int)
 void setAttachment(Object object)
          Implementation of ILnkPeerEndpoint.setAttachment(java.lang.Object)
 void setContainer(LnkContainer container)
          Implementation of ILnkPeerEndpoint.setContainer(com.neeve.link.LnkContainer)
 String toString()
          Get a string representation of this link endpoint.
 
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

create

public static ILnkPeerEndpoint create(RootConfig.ObjectConfig config,
                                      ILnkPeerEndpointCore pep,
                                      HashMap<String,Object> props,
                                      String type)
                               throws ELnkException
Create a link peer endpoint.

Parameters:
config - The object to use to configure the endpoint object.
pep - The wrapped endpoint implementation.
props - A property table used to configure the endpoint.
type - A string describing the link type. This is the value that will be returned by the getType() method.
Throws:
ELnkException - Thrown in case an error occurs while creating the peer endpoint.

setAttachment

public final void setAttachment(Object object)
Implementation of ILnkPeerEndpoint.setAttachment(java.lang.Object)

Specified by:
setAttachment in interface ILnkPeerEndpoint

getAttachment

public final Object getAttachment()
Implementation of ILnkPeerEndpoint.getAttachment()

Specified by:
getAttachment in interface ILnkPeerEndpoint
Returns:
Returns the current attachment.

getName

public String getName()
Implementation of ILnkPeerEndpoint.getName()

Specified by:
getName in interface ILnkPeerEndpoint
Returns:
Returns the name that uniquely identifies the endpoint in the link registry.

getNameInternal

public String getNameInternal()
Implementation of ILnkPeerEndpoint.getNameInternal()

Specified by:
getNameInternal in interface ILnkPeerEndpoint
Returns:
Returns the name that is generated by the link to identify itself.

Each endpoint generates a unique name to identify itself. The internally generated name is used as the name of the endpoint (returned by the ILnkPeerEndpoint.getName() method) in case the user does not override it (e.g. by using the 'name' property in the link descriptor). This method returns the internal name generated by the endpoint for itself. The name returned by this method will be the same as the name returned by ILnkPeerEndpoint.getName() in case the user has not overriden the endpoints internally generated name.


getType

public String getType()
Implementation of ILnkPeerEndpoint.getType()

Specified by:
getType in interface ILnkPeerEndpoint
Returns:
Returns a string describing the link type for this endpoint.

This method returns the type of the link for this endpoint. This is only used for tracing and debugging purposes.


getLtp

public short getLtp()
Implementation of ILnkPeerEndpoint.getLtp()

Specified by:
getLtp in interface ILnkPeerEndpoint
Returns:
Returns the identifier of this link endpoint as a node in a link tree. This identifier is used to route events up the link tree to the endpoint. Each link peer endpoint has a unique LTP within the link tree to which it belongs.

getWhenCreated

public final Date getWhenCreated()
Implementation of ILnkPeerEndpoint.getWhenCreated()

Specified by:
getWhenCreated in interface ILnkPeerEndpoint
Returns:
Returns a date object indicating when this endpoint was created. The date object stores the creation time measured to the nearest millsecond.

getState

public final ILnkPeerEndpoint.State getState()
Implementation of ILnkPeerEndpoint.getState()

Specified by:
getState in interface ILnkPeerEndpoint
Returns:
Returns the endpoints state.

getNextSequenceNum

public final long getNextSequenceNum()
Implementation of ILnkPeerEndpoint.getNextSequenceNum()

Specified by:
getNextSequenceNum in interface ILnkPeerEndpoint

getHandlerChain

public final ILnkPeerEndpoint.EventHandlerChain getHandlerChain()
Implementation of ILnkPeerEndpoint.getHandlerChain()

Specified by:
getHandlerChain in interface ILnkPeerEndpoint

isGroupEndpoint

public final boolean isGroupEndpoint()
Implementation of ILnkPeerEndpoint.isGroupEndpoint()

Specified by:
isGroupEndpoint in interface ILnkPeerEndpoint
Returns:
Returns true if this endpoint connects to an entity that manages communication groups.

Some link implementations connect to entities that manage communication groups. With such links, the user can join one or more communication groups and communicate with other members of the group. Groups are addressed using topics that are wildcard enabled hierarchical strings. The group communication semantics e.g. delivery reliability and ordering, membership management etc is defined by the link implementation.


isRootEndpoint

public final boolean isRootEndpoint()
Implementation of ILnkPeerEndpoint.isRootEndpoint()

Specified by:
isRootEndpoint in interface ILnkPeerEndpoint
Returns:
Returns true if this is the root endpoint of the link tree to which this endpoint belongs.

getRootEndpoint

public final ILnkRootEndpoint getRootEndpoint()
Implementation of ILnkPeerEndpoint.getRootEndpoint()

Specified by:
getRootEndpoint in interface ILnkPeerEndpoint
Returns:
Returns the root endpoint in the endpoint's link tree.

isReadOperational

public final boolean isReadOperational()
Implementation of ILnkPeerEndpoint.isReadOperational()

Specified by:
isReadOperational in interface ILnkPeerEndpoint
Returns:
Returns true if the read machinery is operational and false otherwise.

getContainer

public final LnkContainer getContainer()
Implementation of ILnkPeerEndpoint.getContainer()

Specified by:
getContainer in interface ILnkPeerEndpoint
Returns:
Returns the endpoint's link container. A null return value indicates that the endpoint is designated as private and is not in any link container.

setContainer

public final void setContainer(LnkContainer container)
                        throws ELnkInvalidStateException,
                               ELnkPrivateException,
                               ELnkReadOperationalException,
                               ELnkNotCompatibleException
Implementation of ILnkPeerEndpoint.setContainer(com.neeve.link.LnkContainer)

Specified by:
setContainer in interface ILnkPeerEndpoint
Parameters:
container - The container to which this endpoint is to be moved. The method will do nothing in case this specifies the container in which the endpoint is currently in.
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to migrate a failed, closing or closed endpoint.
ELnkPrivateException - Thrown in case the user is attempting to migrate a private endpoint.
ELnkReadOperationalException - Thrown in case the user is attempting to migrate a link whose read is operational.
ELnkNotCompatibleException - Thrown in case the endpoint is not compatible with the new container.

This method migrates an endpoint to a new container. The endpoint can only be migrated in case the endpoint is in a connected state, is not a private endpoint, the read not operational on the endpoint's link tree and the threading model of the endpoint's link tree is compatible with the new container.


getEnqueuedSize

public final int getEnqueuedSize()
                          throws ELnkInvalidStateException
Implementation of ILnkPeerEndpoint.getEnqueuedSize()

Specified by:
getEnqueuedSize in interface ILnkPeerEndpoint
Returns:
Returns the serialized length of the enqueued packets.
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to get the enqueued packet size in a failed or closed endpoint.

isJoined

public final boolean isJoined(short ltp)
Implementation of ILnkPeerEndpoint.isJoined(short)

Specified by:
isJoined in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user for which to perform the check. An caller should specify -1 or the LTP returned by the ILnkPeerEndpoint.getLtp() method to indicate an end user.
See Also:
ILnkPeerEndpoint.join(short, com.neeve.link.ILnkEventHandler), ILnkPeerEndpoint.leave(short, int)

join

public final void join(short ltp,
                       ILnkEventHandler handler)
                throws ELnkInvalidStateException,
                       ELnkAlreadyJoinedException,
                       ELnkMaxUsersReachedException
Implementation of ILnkPeerEndpoint.join(short, com.neeve.link.ILnkEventHandler)

Specified by:
join in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user that is joining the endpoint. An end user should specify either -1 or the LTP returned by the ILnkPeerEndpoint.getLtp() method in this parameter.
handler - The event handler to be associated with the joining user. Each event that is dispatched by an endpoint is targeted towards one or more endpoint nodes in the link tree to which the source endpoint belongs. The handler through which an event is to be dispatched is determined by the LTP of the endpoint node to which the event is targeted. The mechanism by which events are mapped to their recipients is event type specific. For example, packet event recipients are determined via the LTP present in a packet while flush completion events are dispatched to endpoints that have issued enque or flush requests that resulted in incomplete flushes with the flush scheduled for asynchronous completion. Refer to event type documentation for how the receipients for events of a particular type is determined.
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to join a failed, closing or closed endpoint.
ELnkAlreadyJoinedException - Thrown in case a user with the specified LTP has already joined the endpoint.
ELnkMaxUsersReachedException - Thrown in case the maximum number of configured users for the link has already been reached. Default is LnkLTPAuthority.MAX_LTP + 1.

This method is used by a user of a peer endpoint to register itself with the endpoint. Once the user is registered, it can send packets through the endpoint via the ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int) and ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext) methods and to receive packets and other events from the endpoint through the handler specified in handler parameter. When an event is dispatched by the endpoint (including packet events), the endpoint determines the event's recipient endpoint(s) using an event type specific mechanism. The event is then dispatched through the registered event handlers corresponding to the LTPs of the event receipient(s). In case no event handler is found, the event is dropped.

An end user should specify an LTP of -1 (indicating 'this' endpoint) or the value obtained from the ILnkPeerEndpoint.getLtp() method. A layered endpoint user should specify its own LTP when invoking this method.

See Also:
ILnkPeerEndpoint.isJoined(short), ILnkPeerEndpoint.leave(short, int)

leave

public final void leave(short ltp,
                        int flags)
                 throws ELnkInvalidStateException,
                        ELnkFlushInProgressException,
                        ELnkNotJoinedException,
                        ELnkOpFailedException
Implementation of ILnkPeerEndpoint.leave(short, int)

Specified by:
leave in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user that is leaving the endpoint. An end user should specify either -1 or the LTP returned by the ILnkPeerEndpoint.getLtp() method in this parameter.
flags - Flags used to qualify the leave operation. The following flags are permissible for use here:
- ILnkEndpoint.LVFLAG_ALLOW_FLUSH_PENDING
- ILnkEndpoint.LVFLAG_SUPPRESS_IMPLICT_CLOSE
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to leave a closed endpoint.
ELnkFlushInProgressException - Thrown in case there is a flush currently in progress that is pending async completion. This exception will not be thrown if ILnkEndpoint.LVFLAG_ALLOW_FLUSH_PENDING is specified in the flags parameter.
ELnkNotJoinedException - Thrown in case the user with the specified LTP has not joined the endpoint.
ELnkOpFailedException - Thrown in case the leave resulted in a close being invoked and there was an exception encountered during the close operation.

This method is used by a user of an endpoint to deregister itself from the endpoint. If the leave results in all users having left the endpoint, this method issues an implicit close on the endpoint unless instructed not to do so via the flags. See ILnkPeerEndpoint.close(short) for details on the close operation.

An end user should specify an LTP of -1 (indicating 'this' endpoint) or the value obtained from the ILnkPeerEndpoint.getLtp() method. A layered endpoint should specify its own LTP when invoking this method.

See Also:
ILnkPeerEndpoint.join(short, com.neeve.link.ILnkEventHandler), ILnkPeerEndpoint.close(short)

enque

public final boolean enque(short ltp,
                           PktPacket packet,
                           ILnkPeerEndpoint.FlushContext flushContext,
                           int flags)
                    throws ELnkInvalidStateException,
                           ELnkNotOwnerException,
                           ELnkNotJoinedException,
                           ELnkFlushInProgressException,
                           ELnkOpFailedException
Implementation of ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int)

Specified by:
enque in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user that is issuing the enque. This parameter is only used in case (1) the provided flush context specified in the flushContext parameter in as async flush context (2) the enque operation results in an automatic flush (3) the flush could not be completed synchronously and was scheduled for asynchronous completion. In this case, this LTP is marked as a recipient of the flush completion event. When the asynchronous flush completes, the flush completion event is dispatched through the event handler associated with this LTP. An end user should specify either -1 or the LTP obtained from the ILnkPeerEndpoint.getLtp() method. This parameter is ignored in case the user has provided a synchronous blocking or synchronous non-blocking flush context.
packet - The packet to enque
flushContext - A context object indicating the IO semantics to be used in case the link is automatically flushed from within this method (due to some policy implemented by the endpoint such as auto flush based on packet queue size) alongwith runtime context information related to the flush
flags - Flags used to qualify the enque operation. The following flags are permissible for use here:
- ILnkEndpoint.IOFLAG_FLUSH_SUPPRESS
- ILnkEndpoint.IOFLAG_FLUSH_FORCE
Returns:
Returns true in case the method did attempt to automatically flush the packet queue. Returns false in case the packet was only enqueued and no flush was attempted.

This method serializes and enques a packet at the endpoint for flush at a later point. Once serialized, the packet queue is conditionally flushed depending on internal auto flush policies implemented by the endpoint. See ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext) for more information on how the flushContext parameter is used and updated by the endpoint in case of an auto flush. In the event that the enque causes the endpoint to e automatically flushed and the flush is scheduled for asynchronous completion, the LTP supplied in the ltp parameter is stored and the flush completion event dispatched through the handler associated with the LTP when the flush completes.

In case of an implicit flush, this method may choose to flush only a part of the set of enqueued packets. The caller should either specify the use ILnkEndpoint.IOFLAG_FLUSH_FORCE flags or explicitly invoke ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext) to ensure that all enqueued packets are flushed.

The sender should assume that the act of enqueuing a packet in an endpoint transfers ownership of the packet to the endpoint i.e. the endpoint may choose to hold onto the non-serialized packet subsequent to return from the method. If the endpoint assumes packet ownership, it does so by incrementing the packet's reference count. Although the caller can conditionally decide what to do with the packet by inspecting the packet's reference count (PktPacket.getOwnerCount(), the simplest, consistent and optimal operation to perform post enque is to PktPacket.dispose() the packet. If the endpoint did not assume ownership of the packet, then the packet will be recycled through its pool (if configured for its type) for the next send by the caller. If it did assume ownership, then the packet will be recycled through the pool when the endpoint is done with the packet. The endpoint never assumes ownership of a packet if this method throws an exception (checked or unchecked).

Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to enque a packet on a failed or closed endpoint
ELnkNotOwnerException - Thrown in case this method is invoked with an async flush context and by a thread that is not the owner of the dispatcher specified in the context.
ELnkNotJoinedException - Thrown in case the user with the specified LTP has not joined the endpoint.
ELnkFlushInProgressException - Thrown in case a previous implicit flush during enque or explicit flush could not complete synchronously, the user elected asynchronous completion of the flush and the flush has not yet completed. It is illegal to enque a packet into an endpoint that is attempting to complete a flush asynchronously.
ELnkOpFailedException - Thrown in case an error was encountered during the enqueing or, more likely, the automatic flushing of the endpoint.

flush

public final void flush(short ltp,
                        ILnkPeerEndpoint.FlushContext flushContext)
                 throws ELnkInvalidStateException,
                        ELnkNotOwnerException,
                        ELnkNotJoinedException,
                        ELnkFlushInProgressException,
                        ELnkOpFailedException
Implementation of ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext)

Specified by:
flush in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user that is issuing this flush. This parameter is only used in case (1) the provided flush context specified in the flushContext parameter in as async flush context (2) the flush could not be completed synchronously and is scheduled for asynchronous completion. In this case, this LTP is marked as a recipient of the flush completion event. When the asynchronous flush completes, the flush completion event is dispatched through the event handler associated with this LTP. An end user should either specify -1 or the LTP obtained from the ILnkPeerEndpoint.getLtp() method. This parameter is ignored in case the user has provided a synchronous blocking or synchronous non-blocking flush context.
flushContext - A context object indicating the IO semantics to be used in case the link is automatically flushed from within this method (due to some policy implemented by the endpoint such as auto flush based on packet queue size) alongwith runtime context information related to the flush
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to flush a failed or closed endpoint.
ELnkNotOwnerException - Thrown in case this method is invoked with an async flush context and by a thread that is not the owner of the dispatcher specified in the context.
ELnkNotJoinedException - Thrown in case the user with the specified LTP has not joined the endpoint.
ELnkFlushInProgressException - Thrown in case a previous implicit flush during enque or explicit flush could not complete synchronously, the user elected asynchronous completion of the flush and the flush has not yet completed. It is illegal to flush an endpoint that is attempting to complete a flush asynchronously.
ELnkOpFailedException - Thrown in case an error was encountered during the flushing of the endpoint.

This method flushes enqueued packets to the remote endpoint. The flush context determines the IO semantics used for the flush operation i.e. sync blocking, sync non-blocking or async. In case the user has requested for async flush, the user should check the contents of the flush context upon return from this method. In case the flush did not complete synchronously, the user needs to drive the specified dispatcher. That will asynchronously drive the flush operation. Upon completion of the flush, the flush context will be updated to indicate that the flush has completed and an LnkEvents.EVENT_FLUSH_COMPLETE event will be dispatched to the user through its registered event handler. It is illegal to enque packets into or flush the endpoint while an asynchronous flush is in progress.

For a flush completing asynchronously, in the event that the endpoint fails and the user is dispatched a failure event before the flush completion event is dispatched, the user will never receive a flush completion event.

For a flush completing asynchronously, it is possible for the flush completion event to be dispatched to the user by a thread different from the owner thread of the dispatcher provided in the asynchronous flush context. The user should check for an appropriately process such a case.


fail

public final void fail(Exception e)
                throws ELnkInvalidStateException,
                       ELnkOpFailedException
Implementation of ILnkPeerEndpoint.fail(java.lang.Exception)

Specified by:
fail in interface ILnkPeerEndpoint
Parameters:
e - The exception that describes the failure. The force failing of the endpoint will ultimately result in the dispatch of an LnkEvents.EVENT_FAILURE event to the user. This exception object will be attached to that event to describe the failure.
Throws:
ELnkInvalidStateException - Thrown in case the user is attempting to fail a failed or closed endpoint or an endpoint whose read machinery is not operational.
ELnkOpFailedException - Thrown in case an error was encountered during the failing of the endpoint.

This method force fails the endpoint. The successful invocation of this method causes the endpoint to terminate the underlying connection and dispatch an LnkEvents.EVENT_FAILURE event through all registered event handlers. The event is always dispatched after the method returns and the state of the endpoint at the time the failure event is dispatched is identical to its state when a genuine failure occurs. This method is present to enable the user to force fail a link connection at strategic points in its execution to test fault handling and recovery scenrios. It is guaranteed that, after this method returns, the user will not receive any received packets and all enque and flush attempts will fail.

A user can only force fail an endpoint that has its read machinery operational. This method will return with an exception indicating an invalid state in case the endpoint is force failed without the read machinery operating.


close

public final void close(short ltp)
                 throws ELnkOpFailedException
Implementation of ILnkPeerEndpoint.close(short)

Specified by:
close in interface ILnkPeerEndpoint
Parameters:
ltp - Specifies the LTP of the user that is issuing the close. An end user should specify either -1 or the LTP obtained from the ILnkPeerEndpoint.getLtp() method.
Throws:
ELnkOpFailedException - Thrown in case an error was encountered during the closing of the endpoint.

This method first invokes ILnkPeerEndpoint.leave(short, int) using the specified ltp with implicit flush suppressed. Then, in case all users have left the endpoint, this method transitions the endpoint to ILnkPeerEndpoint.State.CLOSING and kicks off the close machinery. The closure process may need to be scheduled for asynchronous completion in case it needs to wait for some async operation to complete or to be cancelled. Once the close is complete, the endpoint is transitioned to ILnkPeerEndpoint.State.CLOSED.

The transition from closing to closed state needs to be driven by the following dispatchers/threads:
- Dispatchers associated with read machinery of the link tree to which the closing endpoint belongs.
- Dispatchers associated with any flush operation pending asynhronous completion in the closing endpoint.
- Dispatchers managed and driven internal to the closing endpoint
The user needs to continue to drive any of the above dispatchers that are under its control.


toString

public final String toString()
Get a string representation of this link endpoint.

Overrides:
toString in class Object


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.