com.sun.sgs.impl.io
Class ServerSocketEndpoint

java.lang.Object
  extended by com.sun.sgs.impl.io.AbstractSocketEndpoint
      extended by com.sun.sgs.impl.io.ServerSocketEndpoint
All Implemented Interfaces:
ServerEndpoint<SocketAddress>

public class ServerSocketEndpoint
extends AbstractSocketEndpoint
implements ServerEndpoint<SocketAddress>

An implementation of ServerEndpoint that wraps a local SocketAddress.


Field Summary
static String DEFAULT_REUSE_ADDRESS
          Default value for the reuse-address property if not specified.
static String REUSE_ADDRESS_PROPERTY
          The System property for whether to set the reuse-address property.
 
Fields inherited from class com.sun.sgs.impl.io.AbstractSocketEndpoint
address, executor, numProcessors, transportType
 
Constructor Summary
ServerSocketEndpoint(SocketAddress address, TransportType type)
          Constructs a ServerSocketEndpoint with the given TransportType.
ServerSocketEndpoint(SocketAddress address, TransportType type, Executor executor)
          Constructs a ServerSocketEndpoint with the given TransportType using the given Executor for thread management.
ServerSocketEndpoint(SocketAddress address, TransportType type, Executor executor, int numProcessors)
          Constructs a ServerSocketEndpoint with the given TransportType using the given Executor for thread management.
 
Method Summary
 Acceptor<SocketAddress> createAcceptor()
          Creates an Acceptor to passively listen for connections on this local ServerEndpoint.
 
Methods inherited from class com.sun.sgs.impl.io.AbstractSocketEndpoint
getAddress, getExecutor, getNumProcessors, getTransportType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.sgs.io.ServerEndpoint
getAddress
 

Field Detail

REUSE_ADDRESS_PROPERTY

public static final String REUSE_ADDRESS_PROPERTY
The System property for whether to set the reuse-address property.

See Also:
Constant Field Values

DEFAULT_REUSE_ADDRESS

public static final String DEFAULT_REUSE_ADDRESS
Default value for the reuse-address property if not specified.

See Also:
Constant Field Values
Constructor Detail

ServerSocketEndpoint

public ServerSocketEndpoint(SocketAddress address,
                            TransportType type)
Constructs a ServerSocketEndpoint with the given TransportType. This is the simplest way to create a ServerSocketEndpoint. The returned endpoint will use new daemon threads as necessary for processing events.

Parameters:
address - the socket address to encapsulate
type - the type of transport

ServerSocketEndpoint

public ServerSocketEndpoint(SocketAddress address,
                            TransportType type,
                            Executor executor)
Constructs a ServerSocketEndpoint with the given TransportType using the given Executor for thread management.

Parameters:
address - the socket address to encapsulate
type - the type of transport
executor - an Executor specifying the threading policy

ServerSocketEndpoint

public ServerSocketEndpoint(SocketAddress address,
                            TransportType type,
                            Executor executor,
                            int numProcessors)
Constructs a ServerSocketEndpoint with the given TransportType using the given Executor for thread management. The numProcessors parameter refers to the number of MINA SocketIOProcessors to initially create. numProcessors must be greater than 0.

(Note: A SocketIOProcessor is a MINA implementation detail that controls the internal processing of the IO. It is exposed here to allow clients the option to configure this value, which may aid performance tuning).

Parameters:
address - the socket address to encapsulate
type - the type of transport
executor - An Executor specifying the threading policy
numProcessors - the number of processors available on this system. This value must be greater than 0.
Throws:
IllegalArgumentException - if numProcessors is zero or negative.
Method Detail

createAcceptor

public Acceptor<SocketAddress> createAcceptor()
Creates an Acceptor to passively listen for connections on this local ServerEndpoint.

Specified by:
createAcceptor in interface ServerEndpoint<SocketAddress>
Returns:
an Acceptor configured to listen on this ServerEndpoint

Project Darkstar, Version 0.9.9
2013-07-29 20:40:00

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved