RLPark 1.0.0
Reinforcement Learning Framework in Java

MessageSendClientInfo.java

Go to the documentation of this file.
00001 package rlpark.plugin.rltoys.experiments.scheduling.internal.messages;
00002 
00003 import java.io.ByteArrayOutputStream;
00004 import java.io.IOException;
00005 import java.io.ObjectInputStream;
00006 import java.io.ObjectOutputStream;
00007 
00008 import rlpark.plugin.rltoys.experiments.scheduling.internal.messages.Messages.MessageType;
00009 
00010 
00011 public class MessageSendClientInfo extends Message {
00012   private final ClientInfo clientInfo;
00013 
00014   public MessageSendClientInfo(ClientInfo clientInfo) {
00015     super(MessageType.SendClientName);
00016     this.clientInfo = clientInfo;
00017   }
00018 
00019   protected MessageSendClientInfo(MessageBinary message) throws IOException {
00020     super(message);
00021     ObjectInputStream objIn = ClassLoading.createObjectInputStream(message.contentInputStream(), null);
00022     try {
00023       clientInfo = (ClientInfo) objIn.readObject();
00024     } catch (ClassNotFoundException e) {
00025       throw new RuntimeException(e);
00026     }
00027   }
00028 
00029   @Override
00030   protected void writeContentBuffer(ByteArrayOutputStream out) throws IOException {
00031     new ObjectOutputStream(out).writeObject(clientInfo);
00032   }
00033 
00034   public ClientInfo clientInfo() {
00035     return clientInfo;
00036   }
00037 }
 All Classes Namespaces Files Functions Variables Enumerations
Zephyr
RLPark