Example usage for org.springframework.batch.core.repository.dao XStreamExecutionContextStringSerializer afterPropertiesSet

List of usage examples for org.springframework.batch.core.repository.dao XStreamExecutionContextStringSerializer afterPropertiesSet

Introduction

In this page you can find the example usage for org.springframework.batch.core.repository.dao XStreamExecutionContextStringSerializer afterPropertiesSet.

Prototype

@Override
    public void afterPropertiesSet() throws Exception 

Source Link

Usage

From source file:io.spring.batch.xstream.SerializationTest.java

@Test
public void testDeserialization() throws Exception {
    XStreamExecutionContextStringSerializer serializer = new XStreamExecutionContextStringSerializer();
    serializer.afterPropertiesSet();

    serializer/*from   ww  w .j a va  2  s  . co  m*/
            .deserialize(new ByteArrayInputStream(EXAMPLE_EXECUTION_CONTEXT.getBytes(StandardCharsets.UTF_8)));
}

From source file:admin.service.SimpleJobServiceFactoryBean.java

public void afterPropertiesSet() throws Exception {

    Assert.notNull(dataSource, "DataSource must not be null.");
    Assert.notNull(jobRepository, "JobRepository must not be null.");
    Assert.notNull(jobLocator, "JobLocator must not be null.");
    Assert.notNull(jobLauncher, "JobLauncher must not be null.");

    jdbcTemplate = new JdbcTemplate(dataSource);

    if (incrementerFactory == null) {
        incrementerFactory = new DefaultDataFieldMaxValueIncrementerFactory(dataSource);
    }/*from ww  w. j ava 2s.  com*/

    if (databaseType == null) {
        databaseType = DatabaseType.fromMetaData(dataSource).name();
        logger.info("No database type set, using meta data indicating: " + databaseType);
    }

    if (lobHandler == null) {
        lobHandler = new DefaultLobHandler();
    }

    if (serializer == null) {
        XStreamExecutionContextStringSerializer defaultSerializer = new XStreamExecutionContextStringSerializer();
        defaultSerializer.afterPropertiesSet();

        serializer = defaultSerializer;
    }

    Assert.isTrue(incrementerFactory.isSupportedIncrementerType(databaseType), "'" + databaseType
            + "' is an unsupported database type.  The supported database types are "
            + StringUtils.arrayToCommaDelimitedString(incrementerFactory.getSupportedIncrementerTypes()));

}