Instances of the specified class will use the specified serializer when {@link #register(Class)} or
{@link #register(Class, int)} are called.
@see #setDefaultSerializer(Class)
961009
public void addDefaultSerializer (Class type, Serializer serializer) {
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
		insertDefaultSerializer(type, new SingletonSerializerFactory(serializer));
	}
40240
public SerializerRegistry registerAbstract(Class<?> abstractType, Class<? extends TypeSerializer> serializer) {
    return registerAbstract(abstractType, calculateTypeId(abstractType), new DefaultTypeSerializerFactory(serializer));
  }
17786
protected Serializer serializer() {
    Serializer serializer = this.serializer;
    if (serializer == null) {
      synchronized (this) {
        serializer = this.serializer;
        if (serializer == null) {
          NamespaceConfig config = this.config.getNamespaceConfig();
          if (config == null) {
            serializer = Serializer.using(Namespaces.BASIC);
          } else {
            serializer = Serializer.using(Namespace.builder()
                .register(Namespaces.BASIC)
                .nextId(Namespaces.BEGIN_USER_CUSTOM_ID)
                .register(new Namespace(config))
                .build());
          }
          this.serializer = serializer;
        }
      }
    }
    return serializer;
  }
889535
public void init(final SerializedDataTypeRegistry typeRegistry, final DeserializerRegistry deserRegistry,
            final SerializerRegistry serRegistry) {
        if (initialized) {
            throw new IllegalStateException("Instance already initialized - Don't call the init methods more than once");
        }
        this.typeRegistry = typeRegistry;
        for (final JsonbDeserializer<?> deserializer : deserializers) {
            if (deserializer instanceof DeserializerRegistryRequired) {
                if (deserRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one deserializer that requires a 'DeserializerRegistry', but you didn't provide one (deserializer="
                                    + deserializer.getClass().getName() + ")");
                }
                final DeserializerRegistryRequired des = (DeserializerRegistryRequired) deserializer;
                des.setRegistry(deserRegistry);
            }
            if (deserializer instanceof SerializedDataTypeRegistryRequired) {
                if (typeRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one deserializer that requires a 'SerializedDataTypeRegistry', but you didn't provide one (deserializer="
                                    + deserializer.getClass().getName() + ")");
                }
                final SerializedDataTypeRegistryRequired des = (SerializedDataTypeRegistryRequired) deserializer;
                des.setRegistry(typeRegistry);
            }
        }
        for (final JsonbSerializer<?> serializer : serializers) {
            if (serializer instanceof SerializerRegistryRequired) {
                if (serRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one serializer that requires a 'SerializerRegistry', but you didn't provide one (serializer="
                                    + serializer.getClass().getName() + ")");
                }
                final SerializerRegistryRequired ser = (SerializerRegistryRequired) serializer;
                ser.setRegistry(serRegistry);
            }
            if (serializer instanceof SerializedDataTypeRegistryRequired) {
                if (typeRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one serializer that requires a 'SerializedDataTypeRegistry', but you didn't provide one (serializer="
                                    + serializer.getClass().getName() + ")");
                }
                final SerializedDataTypeRegistryRequired ser = (SerializedDataTypeRegistryRequired) serializer;
                ser.setRegistry(typeRegistry);
            }
        }
        initialized = true;
    }
696996
protected void registerDefaultDatatypes() {

    registerStandardDatatype(String.class);
    registerStandardDatatype(Boolean.class);
    registerStandardDatatype(Character.class);
    registerStandardDatatype(Currency.class);
    registerCustomDatatype(Datatype.class); // internal trick...
    registerNumberDatatypes();
    registerJavaTimeDatatypes();
    registerJavaUtilDateCalendarDatatypes();
  }
603632
public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
		if (type == null || serializerClass == null) {
			throw new NullPointerException("Cannot register null class or serializer.");
		}
		defaultKryoSerializerClasses.put(type, serializerClass);
	}
1303901
protected void setSerializationService(ServiceReference<SerializationService> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "setSerializationService", "setting " + ref);
        }
        serializationServiceRef.setReference(ref);
    }
416697
public <T> void setSerializer (Class<T> type, JsonSerializer<T> serializer) {
		classToSerializer.put(type, serializer);
	}
449244
public OBinarySerializer<?> getObjectSerializer(final byte identifier) {
    OBinarySerializer<?> impl = serializerIdMap.get(identifier);
    if (impl == null) {
      final Class<? extends OBinarySerializer<?>> cls = serializerClassesIdMap.get(identifier);
      if (cls != null)
        try {
          impl = cls.newInstance();
        } catch (Exception e) {
          OLogManager.instance().error(this, "Cannot create an instance of class %s invoking the empty constructor", cls);
        }
    }
    return impl;
  }
860192
public SerializerConfig setClass(final Class<? extends Serializer> clazz) {
        String className = clazz == null ? null : clazz.getName();
        return setClassName(className);
    }
514973
protected Serializer serializer() {
    if (serializer == null) {
      NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
      if (namespaceConfig == null) {
        namespaceConfig = new NamespaceConfig();
      }

      SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
      serializerBuilder.withNamespace(new Namespace(namespaceConfig));

      if (config.isRegistrationRequired()) {
        serializerBuilder.withRegistrationRequired();
      }
      if (config.isCompatibleSerialization()) {
        serializerBuilder.withCompatibleSerialization();
      }

      if (config.getElementType() != null) {
        serializerBuilder.addType(config.getElementType());
      }
      if (!config.getExtraTypes().isEmpty()) {
        serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
      }

      serializer = serializerBuilder.build();
    }
    return serializer;
  }
92740
public MethodConfigBuilder setParamsSerializer(Class<? extends Serializer> serializerClass) {
        for (ParamConfigBuilder b : methodParamConfigBuilders) {
            b.setSerializer(serializerClass);
        }
        return this;
    }
980695
@SuppressWarnings("rawtypes")
	public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
		if (type == null || serializerClass == null) {
			throw new NullPointerException("Cannot register null class or serializer.");
		}

		@SuppressWarnings("unchecked")
		Class<? extends Serializer<?>> castedSerializerClass = (Class<? extends Serializer<?>>) serializerClass;
		registeredTypesWithKryoSerializerClasses.put(type, castedSerializerClass);
	}
265201
public static void registerMarshallers(SerializationContext ctx) {
      ctx.registerMarshaller(new QueryRequest.NamedParameter.Marshaller());
      ctx.registerMarshaller(new QueryRequest.Marshaller());
      ctx.registerMarshaller(new QueryResponse.Marshaller());
      ctx.registerMarshaller(new FilterResultMarshaller());
      ctx.registerMarshaller(new ContinuousQueryResult.ResultType.Marshaller());
      ctx.registerMarshaller(new ContinuousQueryResult.Marshaller());
   }
1221030
protected final void instantiateDeserializationUtils() {
		this.deserializedFields1 = new Object[this.serializers.length];
		this.deserializedFields2 = new Object[this.serializers.length];
		
		for (int i = 0; i < this.serializers.length; i++) {
			this.deserializedFields1[i] = this.serializers[i].createInstance();
			this.deserializedFields2[i] = this.serializers[i].createInstance();
		}
	}
676875
@Override
    public void setRealObject(Serializable obj) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setRealObject", (obj == null ? "null" : obj.getClass()));

        // Set all the values for the new 'real' object
        realObject = obj;
        hasRealObject = true;
        hasSerializedRealObject = false;
        // Clear any out of date information in the SoftReference
        softRefToRealObject = null;
        // We have a new payload so get rid of any serialized version of an old payload
        getPayload().setChoiceField(JmsObjectBodyAccess.BODY, JmsObjectBodyAccess.IS_BODY_EMPTY);
        clearCachedLengths();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setRealObject");
    }
1243960
public void addDefaultSerializer (Class type, SerializerFactory serializerFactory) {
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		if (serializerFactory == null) throw new IllegalArgumentException("serializerFactory cannot be null.");
		insertDefaultSerializer(type, serializerFactory);
	}