com.neeve.link.multi
Class LnkMultiServerEndpoint

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.link.multi.LnkMultiObject
          extended by com.neeve.link.multi.LnkMultiServerEndpoint
All Implemented Interfaces:
ILnkServerEndpointCore

public final class LnkMultiServerEndpoint
extends LnkMultiObject
implements ILnkServerEndpointCore

Multi link server endpoint class.

This class is the server endpoint class for the multi link type. An instance of this class is wrapped by the LnkServerEndpoint to provide a full implementation of ILnkServerEndpoint for the multi link type.


Method Summary
 void acceptCancel(int flags)
          Implementation of ILnkServerEndpointCore.acceptCancel(int)
 void acceptPost(IEmxDispatcher dispatcher, ILnkEventHandlerCore handler, int flags)
          Implementation of ILnkServerEndpointCore.acceptPost(com.neeve.emx.IEmxDispatcher, com.neeve.link.ILnkEventHandlerCore, int)
 void close()
          Implementation of ILnkServerEndpointCore.close()
static ILnkServerEndpoint create(com.neeve.util.UtlAddressDescriptor descriptor)
          Create a multi link server 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, toString, wait, wait, wait
 

Method Detail

create

public static ILnkServerEndpoint create(com.neeve.util.UtlAddressDescriptor descriptor)
Create a multi link server endpoint

Parameters:
descriptor - An address descriptor object containing the address and configuration properties to use in creating the endpoint.

acceptPost

public final void acceptPost(IEmxDispatcher dispatcher,
                             ILnkEventHandlerCore handler,
                             int flags)
                      throws ELnkOpFailedException
Implementation of ILnkServerEndpointCore.acceptPost(com.neeve.emx.IEmxDispatcher, com.neeve.link.ILnkEventHandlerCore, int)

Specified by:
acceptPost in interface ILnkServerEndpointCore
Parameters:
dispatcher - The dispatcher in whose context the completion event is to be dispatched. The user will ensure that the the invoking thread is the owner of this dispatcher.
handler - The event handler to which the completion event is to be dispatched.
flags - Flags that qualify the accept operation. The following flags can be set on invocation of this method:
- ILnkEndpoint.IOFLAG_NO_ASYNC: In case this flag is specified and the accept operation could not be completed prior to return from this call, the method should not schedule the accept for asynchronous completion and just return without throwing any exception.
Throws:
ELnkOpFailedException - This exception should be thrown in case a failure was encountered in accepting or initiating the background accept of incoming connections.

This method should accept an incoming link connection request. The result of the connection acceptance should be notified through the dispatch of the LnkEvents.EVENT_CONNECT_COMPLETE event to the provided event handler. It is permissible to dispatch the completion event prior to returning from this method in case the accept could be completed synchronously with success. In the event that the completion event was not dispatched prior to return from this method and the method does not throw an exception, the caller will drive the supplied dispatcher until the completion event is dispatched or the accept is cancelled.

The caller will ensure the following prior to invoking this method:
- Parameter integrity including calling thread validity
- State integrity i.e. this method will never be invoked on a closed endpoint or at any point while a background accept is in progress.

The execution of this method can be qualified through the specification of certain flags in the flags parameter. Refer to flags parameter documentation for the list of permissible flags and for a description of how those flags should qualify the behaviour of this method.

See Also:
ILnkServerEndpointCore.acceptCancel(int)

acceptCancel

public final void acceptCancel(int flags)
Implementation of ILnkServerEndpointCore.acceptCancel(int)

Specified by:
acceptCancel in interface ILnkServerEndpointCore
Parameters:
flags - Flags that qualify the accept cancellation operation. Currently, there are no supported flags for use. This parameter is present for future use. The user will always specify a value of 0 in this parameter.

This method should cancel a previously posted accept operation. A successful return from this method indicates that the accept operation has been cancelled. No completion event for the accept should be dispatched once the accept has been cancelled.

See Also:
ILnkServerEndpointCore.acceptPost(com.neeve.emx.IEmxDispatcher, com.neeve.link.ILnkEventHandlerCore, int)

close

public final void close()
                 throws ELnkOpFailedException
Implementation of ILnkServerEndpointCore.close()

Specified by:
close in interface ILnkServerEndpointCore
Throws:
ELnkOpFailedException - This exception should be thrown in case an error was encountered while closing the endpoint.

This method is used to close a server endpoint and release all underlying system resources allocated to the server endpoint. This method will never be invoked on an endpoint on which an accept is pending.



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