Class SerializerRegistrationsMessage
java.lang.Object
com.jme3.network.AbstractMessage
com.jme3.network.message.SerializerRegistrationsMessage
- All Implemented Interfaces:
Message
Holds a compiled set of message registration information that
can be sent over the wire. The received message can then be
used to register all of the classes using the same IDs and
same ordering, etcetera. The intent is that the server compiles
this message once it is sure that all serializable classes have
been registered. It can then send this to each new client, and
they can use it to register all of the classes without requiring
exactly reproducing the same calls that the server did to register
messages.
Normally, JME recommends that apps have a common utility method that they call on both client and server. However, this makes pluggable services nearly impossible as some central class has to know about all registered serializers. This message implementation gets around by only requiring registration on the server.
- Author:
- Paul Speed
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTransfer object describing a single serializer registration. -
Field Summary
FieldsModifier and TypeFieldDescriptionCached compiled registration entries.Classes that are already built into serializer initialization and should not be re-sent.Cached compiled registration message used for new connections. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty registrations message for serialization.SerializerRegistrationsMessage(SerializerRegistrationsMessage.Registration... registrations) Creates a registrations message containing the specified entries. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcompile()Compiles the current serializer registry into a transferable message.voidApplies all registrations carried by this message to the local serializer registry.Methods inherited from class AbstractMessage
isReliable, setReliable
-
Field Details
-
ignore
-
INSTANCE
Cached compiled registration message used for new connections. -
compiled
Cached compiled registration entries.
-
-
Constructor Details
-
SerializerRegistrationsMessage
public SerializerRegistrationsMessage()Creates an empty registrations message for serialization. -
SerializerRegistrationsMessage
Creates a registrations message containing the specified entries.- Parameters:
registrations- the registrations to send
-
-
Method Details
-
compile
public static void compile()Compiles the current serializer registry into a transferable message. -
registerAll
public void registerAll()Applies all registrations carried by this message to the local serializer registry.
-