Package org.teiid.net.socket
Class SocketServerInstanceImpl
- java.lang.Object
-
- org.teiid.net.socket.SocketServerInstanceImpl
-
- All Implemented Interfaces:
SocketServerInstance
public class SocketServerInstanceImpl extends Object implements SocketServerInstance
Client view of a socket server connection that exposes remote services On construction this class will create a channel and exchange a handshake. That handshake will establish aCryptorto be used for secure traffic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSocketServerInstanceImpl.RemoteInvocationHandler
-
Constructor Summary
Constructors Constructor Description SocketServerInstanceImpl(HostInfo info, long synchTimeout, int soTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect(ObjectChannelFactory channelFactory)CryptorgetCryptor()HostInfogetHostInfo()InetAddressgetLocalAddress()StringgetServerVersion()<T> TgetService(Class<T> iface)longgetSynchTimeout()booleanisOpen()voidread(long timeout, TimeUnit unit, ResultsFuture<?> future)voidsend(Message message, ResultsReceiver<Object> listener, Serializable messageKey)voidshutdown()
-
-
-
Constructor Detail
-
SocketServerInstanceImpl
public SocketServerInstanceImpl(HostInfo info, long synchTimeout, int soTimeout)
-
-
Method Detail
-
connect
public void connect(ObjectChannelFactory channelFactory) throws CommunicationException, IOException
- Throws:
CommunicationExceptionIOException
-
getHostInfo
public HostInfo getHostInfo()
- Specified by:
getHostInfoin interfaceSocketServerInstance
-
getLocalAddress
public InetAddress getLocalAddress()
- Specified by:
getLocalAddressin interfaceSocketServerInstance
-
getServerVersion
public String getServerVersion()
- Specified by:
getServerVersionin interfaceSocketServerInstance
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceSocketServerInstance
-
send
public void send(Message message, ResultsReceiver<Object> listener, Serializable messageKey) throws CommunicationException, InterruptedException
- Specified by:
sendin interfaceSocketServerInstance- Throws:
CommunicationExceptionInterruptedException
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceSocketServerInstance
-
getCryptor
public Cryptor getCryptor()
- Specified by:
getCryptorin interfaceSocketServerInstance- Returns:
- Returns the cryptor.
-
read
public void read(long timeout, TimeUnit unit, ResultsFuture<?> future) throws TimeoutException, InterruptedException- Specified by:
readin interfaceSocketServerInstance- Throws:
TimeoutExceptionInterruptedException
-
getService
public <T> T getService(Class<T> iface)
- Specified by:
getServicein interfaceSocketServerInstance
-
getSynchTimeout
public long getSynchTimeout()
- Specified by:
getSynchTimeoutin interfaceSocketServerInstance
-
-