Package one.nio.rpc
Class RpcClient
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<T>
-
- one.nio.pool.Pool<Socket>
-
- one.nio.pool.SocketPool
-
- one.nio.rpc.RpcClient
-
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Iterable<Socket>,InvocationHandler,Collection<Socket>,Deque<Socket>,List<Socket>,Queue<Socket>,SocketPoolMXBean
public class RpcClient extends SocketPool implements InvocationHandler
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static byte[][]uidLocks-
Fields inherited from class one.nio.pool.SocketPool
connectTimeout, host, port, proxy, readTimeout, sslContext, tos
-
Fields inherited from class one.nio.pool.Pool
closed, createdCount, fifo, initialCount, keepEmpty, maxCount, timeout, timeouts, waitingThreads
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description RpcClient(ConnectionString conn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectinvoke(Object request)Objectinvoke(Object request, int timeout)Objectinvoke(Object proxy, Method method, Object... args)protected ObjectinvokeServiceRequest(Object request)protected voidprovideSerializer(Serializer serializer)protected SerializerrequestSerializer(long uid)protected static ObjectuidLockFor(long uid)-
Methods inherited from class one.nio.pool.SocketPool
createObject, destroyObject, getBusyCount, getConnectTimeout, getFifo, getIdleCount, getMaxCount, getProxy, getReadTimeout, getSslContext, getTimeout, getTimeouts, getWaitingThreads, name, setConnectTimeout, setFifo, setMaxCount, setProperties, setProxy, setReadTimeout, setSslContext, setTimeout
-
Methods inherited from class one.nio.pool.Pool
borrowObject, close, initialize, invalidateAll, invalidateObject, isClosed, returnObject
-
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractSequentialList
iterator
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Methods inherited from interface one.nio.pool.SocketPoolMXBean
invalidateAll, isClosed
-
-
-
-
Constructor Detail
-
RpcClient
public RpcClient(ConnectionString conn)
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method method, Object... args) throws Exception
- Specified by:
invokein interfaceInvocationHandler- Throws:
Exception
-
uidLockFor
protected static Object uidLockFor(long uid)
-
provideSerializer
protected void provideSerializer(Serializer serializer) throws Exception
- Throws:
Exception
-
requestSerializer
protected Serializer requestSerializer(long uid) throws Exception
- Throws:
Exception
-
-