com.sun.sgs.impl.io
Class SocketEndpoint

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

public class SocketEndpoint
extends AbstractSocketEndpoint
implements Endpoint<SocketAddress>

An implementation of Endpoint that wraps a SocketAddress.


Field Summary
 
Fields inherited from class com.sun.sgs.impl.io.AbstractSocketEndpoint
address, executor, numProcessors, transportType
 
Constructor Summary
SocketEndpoint(SocketAddress address, TransportType type)
          Constructs a SocketEndpoint with the given TransportType.
SocketEndpoint(SocketAddress address, TransportType type, Executor executor)
          Constructs a SocketEndpoint with the given TransportType using the given Executor for thread management.
SocketEndpoint(SocketAddress address, TransportType type, Executor executor, int numProcessors)
          Constructs a SocketEndpoint with the given TransportType using the given Executor for thread management.
 
Method Summary
 Connector<SocketAddress> createConnector()
          Creates a Connector for actively initiating a connection to this remote Endpoint.
 
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.Endpoint
getAddress
 

Constructor Detail

SocketEndpoint

public SocketEndpoint(SocketAddress address,
                      TransportType type)
Constructs a SocketEndpoint with the given TransportType. This is the simplest way to create a SocketEndpoint. 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

SocketEndpoint

public SocketEndpoint(SocketAddress address,
                      TransportType type,
                      Executor executor)
Constructs a SocketEndpoint 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

SocketEndpoint

public SocketEndpoint(SocketAddress address,
                      TransportType type,
                      Executor executor,
                      int numProcessors)
Constructs a SocketEndpoint 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

createConnector

public Connector<SocketAddress> createConnector()
Creates a Connector for actively initiating a connection to this remote Endpoint.

Specified by:
createConnector in interface Endpoint<SocketAddress>
Returns:
a Connector configured to connect to this Endpoint

Project Darkstar, Version 0.9.8-SNAPSHOT
2013-07-29 20:21:26

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