Tabnine Logo
SerializingConverter.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.springframework.core.serializer.support.SerializingConverter
constructor

Best Java code snippets using org.springframework.core.serializer.support.SerializingConverter.<init> (Showing top 20 results out of 315)

origin: spring-projects/spring-data-redis

/**
 * Creates a new {@link JdkSerializationRedisSerializer} using the default class loader.
 */
public JdkSerializationRedisSerializer() {
  this(new SerializingConverter(), new DeserializingConverter());
}
origin: spring-projects/spring-data-redis

/**
 * Creates a new {@link JdkSerializationRedisSerializer} using a {@link ClassLoader}.
 *
 * @param classLoader the {@link ClassLoader} to use for deserialization. Can be {@literal null}.
 * @since 1.7
 */
public JdkSerializationRedisSerializer(@Nullable ClassLoader classLoader) {
  this(new SerializingConverter(), new DeserializingConverter(classLoader));
}
origin: spring-projects/spring-session

private GenericConversionService createConversionServiceWithBeanClassLoader() {
  GenericConversionService conversionService = new GenericConversionService();
  conversionService.addConverter(Object.class, byte[].class,
      new SerializingConverter());
  conversionService.addConverter(byte[].class, Object.class,
      new DeserializingConverter(this.classLoader));
  return conversionService;
}
origin: spring-projects/spring-session

private static GenericConversionService createDefaultConversionService() {
  GenericConversionService converter = new GenericConversionService();
  converter.addConverter(Object.class, byte[].class,
      new SerializingConverter());
  converter.addConverter(byte[].class, Object.class,
      new DeserializingConverter());
  return converter;
}
origin: spring-projects/spring-framework

@Test
public void nonSerializableObject() {
  SerializingConverter toBytes = new SerializingConverter();
  try {
    toBytes.convert(new Object());
    fail("Expected IllegalArgumentException");
  }
  catch (SerializationFailedException e) {
    assertNotNull(e.getCause());
    assertTrue(e.getCause() instanceof IllegalArgumentException);
  }
}
origin: spring-projects/spring-framework

@Test
public void serializeAndDeserializeString() {
  SerializingConverter toBytes = new SerializingConverter();
  byte[] bytes = toBytes.convert("Testing");
  DeserializingConverter fromBytes = new DeserializingConverter();
  assertEquals("Testing", fromBytes.convert(bytes));
}
origin: spring-projects/spring-integration

/**
 * A converter for serializing messages to byte arrays for storage.
 *
 * @param serializer the serializer to set
 */
@SuppressWarnings("unchecked")
public void setSerializer(Serializer<? super Message<?>> serializer) {
  this.serializer = new SerializingConverter((Serializer<Object>) serializer);
}
origin: spring-projects/spring-framework

@Test
public void nonSerializableField() {
  SerializingConverter toBytes = new SerializingConverter();
  try {
    toBytes.convert(new UnSerializable());
    fail("Expected SerializationFailureException");
  }
  catch (SerializationFailedException e) {
    assertNotNull(e.getCause());
    assertTrue(e.getCause() instanceof NotSerializableException);
  }
}
origin: spring-projects/spring-integration

/**
 * A converter for serializing messages to byte arrays for storage.
 * @param serializer The serializer to set
 */
@SuppressWarnings("unchecked")
public void setSerializer(Serializer<? super Message<?>> serializer) {
  Assert.notNull(serializer, "The provided serializer must not be null.");
  this.serializer = new SerializingConverter((Serializer<Object>) serializer);
}
origin: spring-projects/spring-integration

/**
 * Create a {@link MessageStore} with all mandatory properties.
 * @param jdbcOperations a {@link JdbcOperations}
 * @since 4.3.9
 */
public JdbcMessageStore(JdbcOperations jdbcOperations) {
  Assert.notNull(jdbcOperations, "'dataSource' must not be null");
  this.jdbcTemplate = jdbcOperations;
  this.deserializer = new WhiteListDeserializingConverter();
  this.serializer = new SerializingConverter();
}
origin: spring-projects/spring-integration

/**
 * Instantiate based on the {@link SerializingConverter} with the
 * {@link org.springframework.core.serializer.DefaultSerializer}.
 */
public PayloadSerializingTransformer() {
  doSetConverter(new SerializingConverter());
}
origin: spring-projects/spring-integration

/**
 * Convenient constructor for configuration use.
 */
public JdbcChannelMessageStore() {
  this.deserializer = new WhiteListDeserializingConverter();
  this.serializer = new SerializingConverter();
}
origin: spring-projects/spring-integration

public void setSerializer(Serializer<Object> serializer) {
  setConverter(new SerializingConverter(serializer));
}
origin: spring-projects/spring-integration

@Bean
@IntegrationConverter
public SerializingConverter serializingConverter() {
  return new SerializingConverter();
}
origin: spring-projects/spring-integration

private ChannelMessageStorePreparedStatementSetter getMessageGroupPreparedStatementSetter() {
  return new ChannelMessageStorePreparedStatementSetter() {
    private SerializingConverter serializer = new SerializingConverter();
    private LobHandler lobHandler = new DefaultLobHandler();
    @Override
    public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage, Object groupId,
        String region, boolean priorityEnabled) throws SQLException {
      super.setValues(preparedStatement, requestMessage, groupId, region, priorityEnabled);
      byte[] messageBytes = this.serializer.convert(requestMessage);
      this.lobHandler.getLobCreator().setBlobAsBytes(preparedStatement, 6, messageBytes);
    }
  };
}
origin: org.springframework.data/spring-data-redis

/**
 * Creates a new {@link JdkSerializationRedisSerializer} using a {@link ClassLoader}.
 *
 * @param classLoader the {@link ClassLoader} to use for deserialization. Can be {@literal null}.
 * @since 1.7
 */
public JdkSerializationRedisSerializer(@Nullable ClassLoader classLoader) {
  this(new SerializingConverter(), new DeserializingConverter(classLoader));
}
origin: org.springframework.integration/spring-integration-jdbc

/**
 * Create a {@link MessageStore} with all mandatory properties.
 * @param jdbcOperations a {@link JdbcOperations}
 * @since 4.3.9
 */
public JdbcMessageStore(JdbcOperations jdbcOperations) {
  Assert.notNull(jdbcOperations, "'dataSource' must not be null");
  this.jdbcTemplate = jdbcOperations;
  this.deserializer = new WhiteListDeserializingConverter();
  this.serializer = new SerializingConverter();
}
origin: org.springframework.integration/spring-integration-core

/**
 * Instantiate based on the {@link SerializingConverter} with the
 * {@link org.springframework.core.serializer.DefaultSerializer}.
 */
public PayloadSerializingTransformer() {
  doSetConverter(new SerializingConverter());
}
origin: org.springframework.data/spring-data-redis

/**
 * Creates a new {@link JdkSerializationRedisSerializer} using the default class loader.
 */
public JdkSerializationRedisSerializer() {
  this(new SerializingConverter(), new DeserializingConverter());
}
origin: org.springframework.integration/spring-integration-jdbc

/**
 * Convenient constructor for configuration use.
 */
public JdbcChannelMessageStore() {
  this.deserializer = new WhiteListDeserializingConverter();
  this.serializer = new SerializingConverter();
}
org.springframework.core.serializer.supportSerializingConverter<init>

Javadoc

Create a default SerializingConverter that uses standard Java serialization.

Popular methods of SerializingConverter

  • convert
    Serializes the source object and returns the byte array result.

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Path (java.nio.file)
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JButton (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now