|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.util.AbstractService
com.sun.sgs.impl.protocol.simple.SimpleSgsProtocolAcceptor
public class SimpleSgsProtocolAcceptor
A protocol acceptor for connections that speak the SimpleSgsProtocol. The constructors
support the following properties:
"com.sun.sgs.impl.protocol.simple.transport"
Delivery.RELIABLE.
"com.sun.sgs.impl.protocol.simple.protocol.version"
SimpleSgsProtocol
version for this acceptor's connections. Valid values for the protocol
version are 0x05 which supports client session
relocation, and 0x04, which does not
support client session relocation but is compatible with clients
using the older protocol version. Protocol version
0x05 is incompatible with clients using
protocol version 0x04.
"com.sun.sgs.impl.protocol.simple.read.buffer.size"
"com.sun.sgs.impl.protocol.simple.disconnect.delay"
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.sgs.impl.util.AbstractService |
|---|
AbstractService.State, AbstractService.Version |
| Field Summary | |
|---|---|
static long |
DEFAULT_DISCONNECT_DELAY
The time (in milliseconds) that a disconnecting connection is allowed before this service forcibly disconnects it. |
static int |
DEFAULT_PROTOCOL_VERSION
The default protocol version: 5. |
static int |
DEFAULT_READ_BUFFER_SIZE
The default read buffer size: 131072. |
static String |
DEFAULT_TRANSPORT
The default transport. |
static String |
DISCONNECT_DELAY_PROPERTY
The name of the disconnect delay property. |
static long |
MIN_DISCONNECT_DELAY
The minimum disconnect delay value. |
static int |
MIN_READ_BUFFER_SIZE
The minimum read buffer size value. |
static String |
PROTOCOL_VERSION_PROPERTY
The protocol version property. |
static int |
PROTOCOL4
The protocol version 4. |
static String |
READ_BUFFER_SIZE_PROPERTY
The name of the read buffer size property. |
protected int |
readBufferSize
The read buffer size for new connections. |
protected Transport |
transport
The transport. |
static String |
TRANSPORT_PROPERTY
The transport property. |
| Fields inherited from class com.sun.sgs.impl.util.AbstractService |
|---|
appName, dataService, IO_TASK_PROPERTY_PREFIX, IO_TASK_RETRIES_PROPERTY, IO_TASK_WAIT_TIME_PROPERTY, logger, maxIoAttempts, retryWaitTime, taskOwner, taskScheduler, transactionScheduler, txnProxy |
| Constructor Summary | |
|---|---|
|
SimpleSgsProtocolAcceptor(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy)
Constructs an instance with the specified properties,
systemRegistry, and txnProxy. |
protected |
SimpleSgsProtocolAcceptor(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy,
LoggerWrapper logger)
Constructs an instance with the specified properties,
systemRegistry, txnProxy, and logger. |
| Method Summary | |
|---|---|
void |
accept(ProtocolListener protocolListener)
Starts accepting connections, and notifies the specified listener of new connections. |
Identity |
authenticate(String name,
String password)
Returns the authenticated identity for the specified name and
password. |
void |
close()
Shuts down any pending accept operation as well as the acceptor itself. |
void |
doReady()
Performs ready operations. |
void |
doShutdown()
Performs shutdown operations. |
ProtocolDescriptor |
getDescriptor()
Returns the descriptor for this protocol. |
protected void |
handleServiceVersionMismatch(AbstractService.Version oldVersion,
AbstractService.Version currentVersion)
Handles conversion from the oldVersion to the currentVersion. |
void |
monitorDisconnection(SessionProtocol protocol)
Adds the specified protocol to the map containing SessionProtocols that are disconnecting. |
void |
scheduleNonTransactionalTask(KernelRunnable task)
Schedules a non-durable, non-transactional task. |
| Methods inherited from class com.sun.sgs.impl.util.AbstractService |
|---|
callFinished, callStarted, checkNonTransactionalContext, checkServiceVersion, createTaskQueue, getDataService, getName, getState, isAlive, isInInitializedState, isRetryableException, ready, runIoTask, shutdown, shuttingDown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String READ_BUFFER_SIZE_PROPERTY
public static final int DEFAULT_READ_BUFFER_SIZE
public static final int MIN_READ_BUFFER_SIZE
public static final String TRANSPORT_PROPERTY
public static final String DEFAULT_TRANSPORT
public static final String PROTOCOL_VERSION_PROPERTY
public static final int PROTOCOL4
public static final int DEFAULT_PROTOCOL_VERSION
public static final String DISCONNECT_DELAY_PROPERTY
public static final long DEFAULT_DISCONNECT_DELAY
public static final long MIN_DISCONNECT_DELAY
protected final int readBufferSize
protected final Transport transport
| Constructor Detail |
|---|
public SimpleSgsProtocolAcceptor(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy)
throws Exception
properties,
systemRegistry, and txnProxy.
properties - the configuration propertiessystemRegistry - the system registrytxnProxy - a transaction proxy
Exception - if a problem occurs
protected SimpleSgsProtocolAcceptor(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy,
LoggerWrapper logger)
throws Exception
properties,
systemRegistry, txnProxy, and logger.
properties - the configuration propertiessystemRegistry - the system registrytxnProxy - a transaction proxylogger - a logger for this instance
Exception - if a problem occurs| Method Detail |
|---|
protected void handleServiceVersionMismatch(AbstractService.Version oldVersion,
AbstractService.Version currentVersion)
oldVersion to the currentVersion. This method is invoked by checkServiceVersion if a version mismatch is detected and is invoked
from within a transaction.
handleServiceVersionMismatch in class AbstractServiceoldVersion - the old versioncurrentVersion - the current versionpublic void doReady()
ready method only once so that the subclass can
perform any operations necessary during the "ready" phase.
doReady in class AbstractServicepublic void doShutdown()
shutdown method only once so that the
subclass can perform any operations necessary to shutdown the
service.
doShutdown in class AbstractServicepublic ProtocolDescriptor getDescriptor()
getDescriptor in interface ProtocolAcceptor
public void accept(ProtocolListener protocolListener)
throws IOException
listener of new connections.
When an incoming connection with a given identity is established
with this protocol acceptor, the protocol acceptor should invoke the
provided listener's newLogin
method with the identity and the protocol
connection.
accept in interface ProtocolAcceptorprotocolListener - a protocol listener
IOException - if an IO problem occurspublic void close()
close in interface ProtocolAcceptor
public Identity authenticate(String name,
String password)
throws LoginException
name and
password.
name - a namepassword - a password
LoginException - if a problem occurs authenticating the name and
passwordpublic void monitorDisconnection(SessionProtocol protocol)
protocol to the map containing SessionProtocols that are disconnecting. The map is keyed by
connection expiration time. The connection will expire after a fixed
delay and will be forcibly terminated if the client hasn't already
closed the connection.
protocol - a SessionProtocol that is disconnectingpublic void scheduleNonTransactionalTask(KernelRunnable task)
task.
task - a non-durable, non-transactional task
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||