Class SerializationServices

    • Field Detail

      • defaultsendserializer

        protected ISerializer defaultsendserializer
        Default serializer used for sending.
      • optimizedsendserializer

        protected ISerializer optimizedsendserializer
        Optimized serializer used for sending to platforms with the same version.
      • serializers

        protected ISerializer[] serializers
        All available serializers
      • sendcodecs

        protected ICodec[] sendcodecs
        Codecs used for sending.
      • codecs

        protected ICodec[] codecs
        All available codecs.
      • postprocessors

        protected ITraverseProcessor[] postprocessors
        Postprocessors for decoding.
      • references

        protected java.util.Map<java.lang.Class<?>,​boolean[]> references
        The reference class cache (clazz->boolean (is reference)).
      • secserv

        protected ISecurityService secserv
        The security service which injects itself once available.
      • sameversioncache

        protected IRwMap<IComponentIdentifier,​java.lang.Boolean> sameversioncache
        Cache for identifying platforms with the same version.
    • Constructor Detail

      • SerializationServices

        public SerializationServices​(IComponentIdentifier comp)
        Creates the management.
    • Method Detail

      • encode

        public byte[] encode​(IMsgHeader header,
                             IInternalAccess component,
                             java.lang.Object obj)
        Encodes/serializes an object for a particular receiver.
        Specified by:
        encode in interface ISerializationServices
        Parameters:
        receiver - The receiver.
        cl - The classloader used for encoding.
        obj - Object to be encoded.
        Returns:
        Encoded object.
      • decode

        public java.lang.Object decode​(IMsgHeader header,
                                       IInternalAccess component,
                                       byte[] enc)
        Decodes/deserializes an object.
        Specified by:
        decode in interface ISerializationServices
        Parameters:
        cl - The classloader used for decoding.
        enc - Encoded object.
        header - The header object if available, null otherwise.
        Returns:
        Object to be encoded.
      • getSendSerializer

        public ISerializer getSendSerializer​(IComponentIdentifier receiverplatform)
        Returns the serializer for sending.
        Parameters:
        receiver - Receiving platform.
        Returns:
        Serializer.
      • getSendCodecs

        public ICodec[] getSendCodecs​(IComponentIdentifier receiver)
        Returns the codecs for sending.
        Parameters:
        receiver - Receiving platform.
        Returns:
        Codecs.
      • getCodecs

        public ICodec[] getCodecs()
        Returns all codecs.
        Returns:
        Codecs.
      • getPostprocessors

        public ITraverseProcessor[] getPostprocessors()
        Gets the post-processors for decoding a received message.
      • getPreprocessors

        public ITraverseProcessor[] getPreprocessors()
        Gets the pre-processors for encoding a received message.
      • createPostprocessors

        public java.util.List<ITraverseProcessor> createPostprocessors()
        Create the preprocessors.
      • getPrefixSize

        protected static final int getPrefixSize​(int codeccount)
      • isLocalReference

        public boolean isLocalReference​(java.lang.Object object)
        Test if an object has reference semantics. It is a reference when: - it implements IRemotable - it is an IService, IExternalAccess or IFuture - if the object has used an @Reference annotation at type level - has been explicitly set to be reference
        Specified by:
        isLocalReference in interface ISerializationServices
      • isRemoteObject

        public boolean isRemoteObject​(java.lang.Object target)
        Test if an object is a remote object.
        Specified by:
        isRemoteObject in interface ISerializationServices
      • setSecurityService

        public void setSecurityService​(ISecurityService secserv)
        Injects the security service.
        Parameters:
        secserv - The security service.
      • getSerializationServices

        public static final ISerializationServices getSerializationServices​(IComponentIdentifier platform)
        Gets the serialization services.
        Parameters:
        platform - The platform ID.
        Returns:
        The serialization services.
      • getRemoteReferenceModule

        public RemoteReferenceModule getRemoteReferenceModule()
        Get the remote reference module.
        Returns:
        the remote reference module.
      • getStringConverters

        public java.util.Map<java.lang.String,​IStringConverter> getStringConverters()
        Get the string converters (can convert to and from string, possibly only for some types).
        Specified by:
        getStringConverters in interface ISerializationServices
        Returns:
        The converters.
      • convertObjectToString

        public java.lang.String convertObjectToString​(java.lang.Object val,
                                                      java.lang.Class<?> type,
                                                      java.lang.ClassLoader cl,
                                                      java.lang.String mediatype,
                                                      java.lang.Object context)
        Convert object to string.
        Specified by:
        convertObjectToString in interface ISerializationServices
        Parameters:
        val - The value.
        Returns:
        The string value.
      • convertStringToObject

        public java.lang.Object convertStringToObject​(java.lang.String val,
                                                      java.lang.Class<?> type,
                                                      java.lang.ClassLoader cl,
                                                      java.lang.String mediatype,
                                                      java.lang.Object context)
        Convert string to object.
        Specified by:
        convertStringToObject in interface ISerializationServices
        Parameters:
        val - The value.
        Returns:
        The object.