hazelcast-all-3.2.5.jar
登录
|
com.hazelcast:hazelcast-all:3.2.5
META-INF
com
hazelcast
queue
nio
SocketClientDataWriter.java
SocketWritable.java
SocketAcceptor.java
SocketPacketWriter.java
ClientPacket.java
DefaultSocketChannelWrapper.java
ObjectDataInput.java
DynamicByteBuffer.java
InSelectorImpl.java
SocketInterceptor.java
IOSelector.java
SocketReader.java
AbstractSelectionHandler.java
NodeIOService.java
Connection.java
ConnectionListener.java
WriteHandler.java
SocketConnector.java
UnsafeHelper.java
ConnectionMonitor.java
BufferObjectDataOutput.java
SocketWriter.java
MemberSocketInterceptor.java
Packet.java
ReadHandler.java
AbstractIOSelector.java
NIOThread.java
IOService.java
OutSelectorImpl.java
ssl
SocketChannelWrapper.java
Protocols.java
IOUtil.java
BufferObjectDataInput.java
ObjectDataOutput.java
SocketReadable.java
ConnectionManager.java
Address.java
SelectionHandler.java
SocketPacketReader.java
ClassLoaderUtil.java
ascii
TcpIpConnection.java
TcpIpConnectionManager.java
SocketClientDataReader.java
UTFEncoderDecoder.java
serialization
ConnectionType.java
CipherHelper.java
core
spring
query
config
partition
mapreduce
aws
security
web
monitor
examples
transaction
wan
util
map
storage
osgi
spi
topic
multimap
cluster
instance
executor
collection
ascii
client
concurrent
logging
jmx
management
hibernate
server.bat
test.bat
hazelcast-download.properties
hazelcast-client-config-3.1.xsd
hazelcast-client-default.xml
hazelcast-default.xml
hazelcast-client-config-3.2.xsd
hazelcast-spring-3.1.xsd
run.sh
server.sh
hazelcast-common-config-3.1.xsd
hazelcast-fullconfig.xml
hazelcast-config-3.1.xsd
hazelcast-runtime.properties
run.bat
client.sh
hazelcast-spring-3.0.xsd
hazelcast-client-config-3.0.xsd
hazelcast-client-full.xml
hazelcast-common-config-3.0.xsd
test.sh
hazelcast-config-3.0.xsd
hazelcast-spring-3.2.xsd
hazelcast-config-3.2.xsd
SocketClientDataReader.java
清空
类结构
/* * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.nio; import com.hazelcast.client.
ClientTypes
; import java.nio.
ByteBuffer
; import java.util.logging.
Level
; import static com.hazelcast.util.
StringUtil
.bytesToString; class
SocketClientDataReader
implements
SocketReader
{ final
TcpIpConnection
connection
; final
IOService
ioService
;
ClientPacket
packet
; boolean
connectionTypeSet
= false; public
SocketClientDataReader
(
TcpIpConnection
connection
) { this.
connection
=
connection
; this.
ioService
=
connection
.
getConnectionManager
().
ioService
; } public void
read
(
ByteBuffer
inBuffer
) throws
Exception
{ while (
inBuffer
.
hasRemaining
()) { if (!
connectionTypeSet
) { if (!
setConnectionType
(
inBuffer
)) { return; }
connectionTypeSet
= true; } if (
packet
== null) {
packet
= new
ClientPacket
(
ioService
.
getSerializationContext
()); } boolean
complete
=
packet
.
readFrom
(
inBuffer
); if (
complete
) {
packet
.
setConn
(
connection
);
ioService
.
handleClientPacket
(
packet
);
packet
= null; } else { break; } } } private boolean
setConnectionType
(
ByteBuffer
inBuffer
) { if (
inBuffer
.
remaining
() >= 3) { byte[]
typeBytes
= new byte[3];
inBuffer
.
get
(
typeBytes
);
String
type
=
bytesToString
(
typeBytes
); if (
ClientTypes
.
JAVA
.
equals
(
type
)) {
connection
.
setType
(
ConnectionType
.
JAVA_CLIENT
); } else if (
ClientTypes
.
CSHARP
.
equals
(
type
)) {
connection
.
setType
(
ConnectionType
.
CSHARP_CLIENT
); } else if (
ClientTypes
.
CPP
.
equals
(
type
)) {
connection
.
setType
(
ConnectionType
.
CPP_CLIENT
); } else if (
ClientTypes
.
PYTHON
.
equals
(
type
)) {
connection
.
setType
(
ConnectionType
.
PYTHON_CLIENT
); } else if (
ClientTypes
.
RUBY
.
equals
(
type
)) {
connection
.
setType
(
ConnectionType
.
RUBY_CLIENT
); } else {
ioService
.
getLogger
(
getClass
().
getName
()).
info
("Unknown client type: " +
type
);
connection
.
setType
(
ConnectionType
.
BINARY_CLIENT
); } return true; } return false; } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口