ALL_COMMANDS.put(Version.GFE_66, gfe66Commands); gfe66Commands.putAll(ALL_COMMANDS.get(Version.GFE_6516)); gfe66Commands.put(MessageType.ADD_PDX_TYPE, AddPdxType.getCommand()); gfe66Commands.put(MessageType.GET_PDX_ID_FOR_TYPE, GetPDXIdForType.getCommand()); gfe66Commands.put(MessageType.GET_PDX_TYPE_BY_ID, GetPDXTypeById.getCommand());
@Override public void cmdExecute(Message msg, ServerConnection servConn, long start) throws IOException, ClassNotFoundException { servConn.setAsTrue(REQUIRES_RESPONSE); if (logger.isDebugEnabled()) { logger.debug("{}: Received get pdx id for type request ({} parts) from {}", servConn.getName(), msg.getNumberOfParts(), servConn.getSocketString()); } int noOfParts = msg.getNumberOfParts(); PdxType type = (PdxType) msg.getPart(0).getObject(); int typeId = msg.getPart(1).getInt(); //The native client needs this line //because it doesn't set the type id on the //client side. type.setTypeId(typeId); try { GemFireCacheImpl cache = (GemFireCacheImpl) servConn.getCache(); TypeRegistry registry = cache.getPdxRegistry(); registry.addRemoteType(typeId, type); } catch (Exception e) { writeException(msg, e, false, servConn); servConn.setAsTrue(RESPONDED); return; } writeReply(msg, servConn); servConn.setAsTrue(RESPONDED); } }
registry.addRemoteType(typeId, type); } catch (Exception e) { writeException(msg, e, false, servConn); servConn.setAsTrue(RESPONDED); return; writeReply(msg, servConn); servConn.setAsTrue(RESPONDED);
ALL_COMMANDS.put(Version.GFE_66, gfe66Commands); gfe66Commands.putAll(ALL_COMMANDS.get(Version.GFE_6516)); gfe66Commands.put(MessageType.ADD_PDX_TYPE, AddPdxType.getCommand()); gfe66Commands.put(MessageType.GET_PDX_ID_FOR_TYPE, GetPDXIdForType.getCommand()); gfe66Commands.put(MessageType.GET_PDX_TYPE_BY_ID, GetPDXTypeById.getCommand());