Toggle navigation
Home
com.ea.orbit.actors.ws.server.PeerSerializer to com.ea.orbit.actors.extensions.MessageSerializer
No. of Instances - 2
No. of Commits - 1
No. of Projects - {'orbit'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Other
null
to
runtime
1
to
MessageDefinitions.REQUEST_MESSAGE
Add or Remove Method invocation
Proxy.newProxyInstance(ref.getClassLoader(),new Class[]{ref},(proxy,method,args) -> { Message message=new Message(); int messageId=messageIdSeed.incrementAndGet(); message.setType(MessageDefinitions.REQUEST_MESSAGE); message.setPayload(args); message.setObjectId(objectId); message.setInterfaceId(ref.getName().replace('$','.').hashCode()); message.setMethodId(computeMethodId(method)); message.setMessageId(messageId); final ByteArrayOutputStream out=new ByteArrayOutputStream(); serializer.serializeMessage(runtime,out,message); final byte[] bytes=out.toByteArray(); final Clock clock=Clock.systemUTC(); long timeoutAt=clock.millis() + 30_000; PendingResponse pendingResponse=new PendingResponse(messageId,timeoutAt); final boolean oneWay=method.isAnnotationPresent(OneWay.class); if (!oneWay) { pendingResponseMap.put(messageId,pendingResponse); pendingResponsesQueue.add(pendingResponse); } final ByteBuffer wrap=ByteBuffer.wrap(bytes); sendBinary(wrap); return pendingResponse; } )
to
Proxy.newProxyInstance(ref.getClassLoader(),new Class[]{ref},(proxy,method,args) -> { Message message=new Message(); int messageId=messageIdSeed.incrementAndGet(); message.setMessageType(MessageDefinitions.REQUEST_MESSAGE); message.setPayload(args); message.setObjectId(objectId); message.setInterfaceId(ref.getName().replace('$','.').hashCode()); message.setMethodId(computeMethodId(method)); message.setMessageId(messageId); final ByteArrayOutputStream out=new ByteArrayOutputStream(); serializer.serializeMessage(runtime,out,message); final byte[] bytes=out.toByteArray(); final Clock clock=Clock.systemUTC(); long timeoutAt=clock.millis() + 30_000; PendingResponse pendingResponse=new PendingResponse(messageId,timeoutAt); final boolean oneWay=method.isAnnotationPresent(OneWay.class); if (!oneWay) { pendingResponseMap.put(messageId,pendingResponse); pendingResponsesQueue.add(pendingResponse); } final ByteBuffer wrap=ByteBuffer.wrap(bytes); sendBinary(wrap); return pendingResponse; } )