Modeling the Spring Bean Application Type

Introduction

The Spring application type consists of two parts:

Modeling the execution of a Spring Bean

The modeling of a Spring application type is very similar to Session Beans and Plain Java applications. Please refer to chapter Integrating Plain Java Classes and Session Beans of the Modeling Guide for more information on general concepts of application type modeling. We assume you are familiar with these concepts.

In order to model a Spring application, select Applications > Spring Bean Application in the diagram's toolbar palette and place it on the canvas.

Double-click the application to open its properties dialog. Click Spring Bean Application in the left tree to access Spring-specific properties.

At first, you have to specify the name of the bean you want to call. Clicking on the Browse... button opens a dialog that allows browsing in a Spring configuration file. The path to the configuration file has to be relative to your current workspace. Don't forget to insure that all necessary classes for your beans are in the classpath of the project which contains your Stardust Model.

After selecting a bean in the bean browser, Stardust initializes the Bean ID and Class entries in the Spring application properties with the entries configured in your Spring configuration. You can also edit these fields manually.

Use the method browser to choose a completion method:

The result is a completely configured Spring application.

You can now define data mappings, exception handlers, etc. in the same way as with Java or J2EE applications.

For more information on Simulation, see chapter Simulation Configurations of the Simulation Guide.

For more information on Effort Planning - please refer to the chapter Process Effort Calculation.

Calling the Spring Bean at Runtime

At runtime, Stardust will use Spring's bean factory mechanisms in order to get an instance of the bean specified in the model. Stardust uses reflection to call the method specified in the model. Depending on your Spring configuration, transactions can be propagated from Stardust to your Spring bean. All aspects, dependency injections and the like will remain unaffected by Stardust.

The Stardust Spring application's runtime component will be called by Stardust whenever a Spring application has to be executed on behalf of a process. You have to make sure that Stardust's Runtime Environment is Spring and that the used Spring configuration includes the Stardust beans as well as your own beans. For a description on how to configure Stardust to run in a Spring environment, please refer to the chapter Spring Runtime Setup.

Configuring Retry Mechanism

The configurable retry mechanism provides the facility to retry the operation in case the target service is temporarily unavailable.

For more information, please refer to Retry Mechanism of Non-interactive Applications section of the Applications chapter.

For example, you have added an application to the model. In the Property page of the application, you can enable the retry, specify number of retries and time between retries. However, note that maximum 10 retries and 60 seconds between two retries are allowed. So, the application will retry for the defined number of times with a pause of the defined number of seconds, until it has success. If the application still fails after the defined number, it will no longer retry.