Deploying Hyperon

Connecting Application via Spring Annotations


  • Java 1.8 or higher
  • Maven 3.x
  • Spring Framework
  • HyperonStudio with H2 database (default for bundle distribution)

We will show how to configure Hyperon Engine using Spring annotated configuration (

Maven configuration

First add Hyperon Runtime dependency to your pom.xml file:


Remember to substitute 1.5.19 above with current version available on Download page. Hyperon Runtime Library will be downloaded by Maven from Maven Central Repo so there is no need to do it manually.

Next add other required libraries for the purpose of this example:

<!-- Spring Framework -->

<!-- Database access libraries -->

Above libraries set up Spring and allows us to connect to H2 database via pooled data source.

Spring configuration

Add required beans to your java class annotated with @Configuration:

private Environment env;

private static final Logger log = LoggerFactory.getLogger(TestConfiguration.class);

public DialectRegistry getDialectRegistry() {
    DialectRegistry registry = new DialectRegistry();
    return registry;

public DialectTemplate getDialectTemplate() {
    return getDialectRegistry().create();

@Bean(destroyMethod = "close")
public DataSource getDataSource() {
    BasicDataSource dataSource = new BasicDataSource();
    return dataSource;

@Bean(destroyMethod = "destroy")
public HyperonEngineFactory getHyperonEngineFactory() {"Engine factory begin creation...");
    HyperonEngineFactory hyperonEngineFactory = new HyperonEngineFactory();
    return hyperonEngineFactory;

public HyperonEngine getHyperonEngine() {"Engine begin creation...");
    return getHyperonEngineFactory().create();

Add @PropertySource("") to your configuration class so that external properties are resolved.

Resource files

Create a file called: with content as follows:


Be sure to properly point hyperon.database.url to your bundle database subdirectory and put the result file in your resource files directory in location specified at @PropertySource above.

If you enable logging, you can see such output after getHyperonEngineFactory().create():

DEBUG [HyperonEngineFactory] - creating Hyperon Runtime component...
INFO  [IntegerType] - cached integer holders: 10000
INFO  [ListRepository] - ParamRepository repository: registering MpParameterProvider
INFO  [MapRepository] - FunctionRepository repository: registering MpPropFunctionProvider ...
INFO  [MapRepository] - FunctionRepository repository: registering MpFunctionProvider ...
INFO  [MapRepository] - FunctionInvoker repository: registering RhinoFunctionInvoker ...
INFO  [MapRepository] - FunctionInvoker repository: registering PropFunctionInvoker ...
INFO  [MapRepository] - Type repository: registering DateType ...
INFO  [MapRepository] - Type repository: registering NumberType ...
INFO  [MapRepository] - Type repository: registering BooleanType ...
INFO  [MapRepository] - Type repository: registering StringType ...
INFO  [MapRepository] - Type repository: registering IntegerType ...
INFO  [MapRepository] - Matcher repository: registering BetweenMatcher ...
INFO  [MapRepository] - Matcher repository: registering ContainsAnyMatcher ...
INFO  [MapRepository] - Matcher repository: registering ContainsNoneMatcher ...
INFO  [MapRepository] - Matcher repository: registering BetweenMatcher ...
INFO  [MapRepository] - Matcher repository: registering InMatcher ...
INFO  [MapRepository] - Matcher repository: registering RegexMatcher ...
INFO  [MapRepository] - Matcher repository: registering LikeMatcher ...
INFO  [MapRepository] - Matcher repository: registering NotInMatcher ...
INFO  [MapRepository] - Matcher repository: registering ContainsAllMatcher ...
DEBUG [HyperonEngineFactory] - created core engine: org.smartparam.engine...
INFO  [HyperonEngineFactory] - runtime mode: production
DEBUG [HyperonEngineFactory] - using value-never-null mode: true
DEBUG [HyperonEngineFactory] - creating domain cache component...
DEBUG [HyperonEngineFactory] - rhino invoker initialized with such global objects:
global variables (10)
1. str=pl.decerto.hyperon.runtime.rhino.RhinoStr@33b40727
2. date=pl.decerto.hyperon.runtime.rhino.RhinoDate@233210d1
3. util=pl.decerto.hyperon.runtime.rhino.RhinoUtil@1504d1f1
5. hyperon=pl.decerto.hyperon.runtime.rhino.RhinoHyperon@5fb8466d
6. domain=pl.decerto.hyperon.runtime.rhino.RhinoDomain@6c3f71d3
7. math=pl.decerto.hyperon.runtime.rhino.RhinoMath@5f07befc
8. type=pl.decerto.hyperon.runtime.rhino.RhinoType@24b59988
9. mpp=pl.decerto.hyperon.runtime.rhino.RhinoHyperon@3923285d

DEBUG [HyperonEngineFactory] - installing function invocation interceptor
INFO  [HyperonEngineFactory] - successfully created Hyperon Runtime component.
More tutorials

Deploying Hyperon