Example usage for org.springframework.core SpringVersion getVersion

List of usage examples for org.springframework.core SpringVersion getVersion

Introduction

In this page you can find the example usage for org.springframework.core SpringVersion getVersion.

Prototype

@Nullable
public static String getVersion() 

Source Link

Document

Return the full version string of the present Spring codebase, or null if it cannot be determined.

Usage

From source file:com.sinosoft.one.mvc.controllers.Utils.java

public static String wrap(String msg) {
    String mvcVersion = MvcVersion.getVersion();
    String springVersion = SpringVersion.getVersion();
    return "@<html><head><title>Paoding Mvc " + mvcVersion + "@Spring-" + springVersion
            + "</title></head><body>" + msg + "<div>" + mvcVersion + "@Spring-" + springVersion
            + "</div></body></html>";
}

From source file:net.paoding.rose.controllers.Utils.java

public static String wrap(String msg) {
    String roseVersion = RoseVersion.getVersion();
    String springVersion = SpringVersion.getVersion();
    return "@<html><head><title>Paoding Rose " + roseVersion + "@Spring-" + springVersion
            + "</title></head><body>" + msg + "<div>" + roseVersion + "@Spring-" + springVersion
            + "</div></body></html>";
}

From source file:com.laxser.blitz.controllers.Utils.java

public static String wrap(String msg) {
    String blitzVersion = BlitzVersion.getVersion();
    String springVersion = SpringVersion.getVersion();
    return "@<html><head><title>Blitz " + blitzVersion + "@Spring-" + springVersion + "</title></head><body>"
            + msg + "<div>" + blitzVersion + "@Spring-" + springVersion + "</div></body></html>";
}

From source file:org.ujorm.hotels.gui.about.AboutPanel.java

public AboutPanel(String id) {
    super(id);/*from   w  w w .  j  a va2  s  .  c om*/

    add(new Label("wicketVersion", getApplication().getFrameworkSettings().getVersion()));
    add(new Label("ujormVersion", UjoManager.version()));
    add(new Label("springVersion", SpringVersion.getVersion()));

}

From source file:com.feilong.commons.core.FeiLongVersionTest.java

/**
 * Test method for {@link com.feilong.commons.core.FeiLongVersion#getVersion()}.
 *//*  w w  w. ja va 2 s.  c om*/
@Test
public final void testGetVersion() {
    log.info(FeiLongVersion.getVersion());
    log.info(SpringVersion.getVersion());

    Package pkg = FeiLongVersion.class.getPackage();
    log.info(JsonUtil.format(pkg));
}

From source file:grails.plugin.cache.CustomCacheKeyGenerator.java

public CustomCacheKeyGenerator() {
    // Use the Spring key generator if the Spring version is 4.0.3 or later
    // Can't use the Spring key generator if < 4.0.3 because of https://jira.spring.io/browse/SPR-11505
    if (SpringVersion.getVersion() == null
            || GrailsVersionUtils.isVersionGreaterThan(SpringVersion.getVersion(), "4.0.3")) {
        this.innerKeyGenerator = new SimpleKeyGenerator();
    } else {/*from w  w w . j a v  a 2s .  c o m*/
        try {
            this.innerKeyGenerator = (KeyGenerator) Class
                    .forName("org.springframework.cache.interceptor.SimpleKeyGenerator").newInstance();
        } catch (Exception e) {
            // this should never happen
            throw new RuntimeException(e);
        }
    }
}

From source file:org.hdiv.config.annotation.DelegatingHdivWebSecurityConfiguration.java

@PostConstruct
public void performVersionChecks() {
    if (SpringVersion.getVersion().compareTo(MIN_SPRING_VERSION) < 0) {
        // Spring version is lower than '4.0.0.RELEASE'
        throw new HDIVException(
                "HDIV JavaConfig feature require Spring version equal or greater than " + MIN_SPRING_VERSION
                        + ". Use XML configuration instead of JavaConfig or update Spring version.");
    }/*from w  ww .j  a  va  2 s .co  m*/
}

From source file:net.hasor.rsf.spring.parser.RsfDefinitionParser.java

/** ?Xml  */
@Override//from   w ww .j av a 2s .c  om
public BeanDefinition parse(Element element, ParserContext parserContext) {
    // Spring 
    String version = SpringVersion.getVersion();
    version = StringUtils.isBlank(version) ? "?" : version;
    Map customEditors = null;
    if (version.charAt(0) == '4' || version.charAt(0) == '5') {
        customEditors = new HashMap<Class<?>, Class<? extends java.beans.PropertyEditor>>();
        customEditors.put(InterAddress.class, RsfAddressPropertyEditor.class);
    } else {
        customEditors = new HashMap();
        customEditors.put("net.hasor.rsf.InterAddress", new RsfAddressPropertyEditor());
    }
    //
    // . Bean 
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();
    builder.getRawBeanDefinition().setBeanClass(CustomEditorConfigurer.class);
    builder.setScope(BeanDefinition.SCOPE_SINGLETON);//?
    builder.addPropertyValue("customEditors", customEditors);
    //
    //  .,BeanID net.hasor.rsf.spring.RsfAddressPropertyEditor
    AbstractBeanDefinition propEditors = builder.getBeanDefinition();
    String beanID = RsfAddressPropertyEditor.class.getName();
    BeanDefinitionHolder holder = new BeanDefinitionHolder(propEditors, beanID);
    BeanDefinitionReaderUtils.registerBeanDefinition(holder, parserContext.getRegistry());
    parserContext.registerComponent(new BeanComponentDefinition(holder));
    //
    //
    NamedNodeMap attributes = element.getAttributes();
    //
    return null;
}

From source file:web.GeneratedBanner.java

private String getSpringVersion() {
    return SpringVersion.getVersion();
}

From source file:org.tec.webapp.jdbc.service.impl.SystemSvcImpl.java

/**
 * {@inheritDoc}//from   w  ww . ja  va 2 s . c o  m
 */
@Override()
public SerializableList<StatusBean> getStatus() {
    Connection conn = null;
    try {
        SerializableList<StatusBean> slist = new SerializableList<StatusBean>();

        // get java information
        slist.add(new StatusBean("java.version", System.getProperty("java.version")));

        //get Servlet information
        slist.add(new StatusBean("server.info", mServletContext.getServerInfo()));

        StringBuilder buff = new StringBuilder();

        buff.append(mServletContext.getMajorVersion());
        buff.append('.');
        buff.append(mServletContext.getMinorVersion());

        slist.add(new StatusBean("servlet.version", buff.toString()));

        // get database information
        conn = mDataSource.getConnection();
        DatabaseMetaData dmd = conn.getMetaData();
        slist.add(new StatusBean("database.server", dmd.getDatabaseProductName()));
        slist.add(new StatusBean("database.version", dmd.getDatabaseProductVersion()));
        slist.add(new StatusBean("jdbc.driver", dmd.getDriverName()));
        slist.add(new StatusBean("jdbc.driver.version", dmd.getDriverVersion()));

        // spring
        slist.add(new StatusBean("spring.version", SpringVersion.getVersion()));

        return slist;
    } catch (Throwable e) {
        throw new RuntimeException("failed to get system status", e);
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Throwable e) {
                mLogger.error("failed to get system status", e);
            }
        }
    }
}