public static SerializerRegistration getSerializerRegistration(Class cls) { return getSerializerRegistration(cls, strictRegistration); }
private void writeType(ByteBuffer buffer, Class<?> clazz) throws IOException{ if (clazz == void.class){ buffer.putShort((short)0); } else { SerializerRegistration reg = Serializer.getSerializerRegistration(clazz); if (reg == null){ logger.log(Level.WARNING, "Unknown class: {0}", clazz); throw new IOException(); // prevents message from being serialized } buffer.putShort(reg.getId()); } }
public static Serializer getSerializer(Class cls, boolean failOnMiss) { return getSerializerRegistration(cls, failOnMiss).getSerializer(); }
/** * Write a class and return its SerializerRegistration. * * @param buffer The buffer to write the given class to. * @param type The class to write. * @return The SerializerRegistration that's registered to the class. */ public static SerializerRegistration writeClass(ByteBuffer buffer, Class type) throws IOException { SerializerRegistration reg = getSerializerRegistration(type); if (reg == null) { throw new SerializerException( "Class not registered:" + type ); } if( log.isLoggable(Level.FINER) ) { log.log(Level.FINER, "writing class:{0} with ID:{1}", new Object[]{type, reg.getId()}); } buffer.putShort(reg.getId()); return reg; }
public static SerializerRegistration getSerializerRegistration(Class cls) { return getSerializerRegistration(cls, strictRegistration); }
public static SerializerRegistration getSerializerRegistration(Class cls) { return getSerializerRegistration(cls, strictRegistration); }
private void writeType(ByteBuffer buffer, Class<?> clazz) throws IOException{ if (clazz == void.class){ buffer.putShort((short)0); } else { SerializerRegistration reg = Serializer.getSerializerRegistration(clazz); if (reg == null){ logger.log(Level.WARNING, "Unknown class: {0}", clazz); throw new IOException(); // prevents message from being serialized } buffer.putShort(reg.getId()); } }
private void writeType(ByteBuffer buffer, Class<?> clazz) throws IOException{ if (clazz == void.class){ buffer.putShort((short)0); } else { SerializerRegistration reg = Serializer.getSerializerRegistration(clazz); if (reg == null){ logger.log(Level.WARNING, "Unknown class: {0}", clazz); throw new IOException(); // prevents message from being serialized } buffer.putShort(reg.getId()); } }
public static Serializer getSerializer(Class cls, boolean failOnMiss) { return getSerializerRegistration(cls, failOnMiss).getSerializer(); }
public static Serializer getSerializer(Class cls, boolean failOnMiss) { return getSerializerRegistration(cls, failOnMiss).getSerializer(); }
/** * Write a class and return its SerializerRegistration. * * @param buffer The buffer to write the given class to. * @param type The class to write. * @return The SerializerRegistration that's registered to the class. */ public static SerializerRegistration writeClass(ByteBuffer buffer, Class type) throws IOException { SerializerRegistration reg = getSerializerRegistration(type); if (reg == null) { throw new SerializerException( "Class not registered:" + type ); } buffer.putShort(reg.getId()); return reg; }
/** * Write a class and return its SerializerRegistration. * * @param buffer The buffer to write the given class to. * @param type The class to write. * @return The SerializerRegistration that's registered to the class. */ public static SerializerRegistration writeClass(ByteBuffer buffer, Class type) throws IOException { SerializerRegistration reg = getSerializerRegistration(type); if (reg == null) { throw new SerializerException( "Class not registered:" + type ); } if( log.isLoggable(Level.FINER) ) { log.log(Level.FINER, "writing class:{0} with ID:{1}", new Object[]{type, reg.getId()}); } buffer.putShort(reg.getId()); return reg; }