com.metamatrix.common.comm.platform.socket.client
Class SocketServerConnection
java.lang.Object
com.metamatrix.common.comm.platform.socket.client.SocketServerConnection
- All Implemented Interfaces:
- ServerConnection
public class SocketServerConnection
- extends java.lang.Object
- implements ServerConnection
Represents a client connection that maintains session state and allows for service fail over.
Implements a sticky random selection policy.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SocketServerConnection
public SocketServerConnection(SocketServerInstanceFactory connectionFactory,
boolean secure,
ServerDiscovery serverDiscovery,
java.util.Properties connProps,
java.util.Timer pingTimer)
throws CommunicationException,
ConnectionException
- Throws:
CommunicationException
ConnectionException
selectServerInstance
public SocketServerInstance selectServerInstance()
throws CommunicationException
- Implements a sticky random selection policy
TODO: make this customizable
TODO: put more information on hostinfo as to process response time, last successful connect, etc.
- Throws:
CommunicationException
authenticate
public void authenticate()
throws ConnectionException,
CommunicationException
- Throws:
ConnectionException
CommunicationException
getService
public <T> T getService(java.lang.Class<T> iface)
- Specified by:
getService
in interface ServerConnection
shutdown
public void shutdown()
- Specified by:
shutdown
in interface ServerConnection
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface ServerConnection
getLogonResult
public LogonResult getLogonResult()
- Specified by:
getLogonResult
in interface ServerConnection
isSameInstance
public boolean isSameInstance(SocketServerConnection otherService)
throws CommunicationException
- Throws:
CommunicationException
selectNewServerInstance
public void selectNewServerInstance(java.lang.Object service)
setFailOver
public void setFailOver(boolean failOver)
Copyright © 2009. All Rights Reserved.