org.teiid.net.socket
Class SocketServerConnection
java.lang.Object
org.teiid.net.socket.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)
throws CommunicationException,
ConnectionException
- Throws:
CommunicationException
ConnectionException
selectServerInstance
public SocketServerInstance selectServerInstance()
throws CommunicationException,
ConnectionException
- 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:
ConnectionException
CommunicationException
getService
public <T> T getService(java.lang.Class<T> iface)
- Specified by:
getService
in interface ServerConnection
close
public void close()
- Specified by:
close
in interface ServerConnection
isOpen
public boolean isOpen(long msToTest)
- Specified by:
isOpen
in interface ServerConnection
getLogonResult
public LogonResult getLogonResult()
- Specified by:
getLogonResult
in interface ServerConnection
isSameInstance
public boolean isSameInstance(ServerConnection otherService)
throws CommunicationException
- Specified by:
isSameInstance
in interface ServerConnection
- Throws:
CommunicationException
cleanUp
public void cleanUp()
- Specified by:
cleanUp
in interface ServerConnection
setFailOver
public void setFailOver(boolean failOver)
setFailOverPingInterval
public void setFailOverPingInterval(int pingFailOverInterval)
Copyright © 2010. All Rights Reserved.