Giter Club home page Giter Club logo

txremovalsample's Introduction

Author: John Lee [email protected]

The starting point for this sample[1].

Sample using the EJB's @Schedule and Native Management API for Transaction removal.

Note that arbitrarily removing entries in the local transaction store can result in recoverable transactions being lost.

The sample runs every 5 seconds and deletes any entry in the tx-object-store over 1 hour old.

to run: export JBOSS_HOME=

/mvn clean install jboss-as:deploy

/mvn jboss-as:undeploy

[1] ejb-timer: EJB Timers example - @Schedule and @Timeout

Author: Ondrej Zizka [email protected]
Level: Beginner
Technologies: EJB 3.1 Timer
Summary: Demonstrates how to use EJB 3.1 Timer (@Schedule and @Timeout) with the JBoss AS server.
Target Product: EAP
Product Versions: EAP 6.1, EAP 6.2
Source: https://github.com/jboss-developer/jboss-eap-quickstarts/

What is it?

Demonstrates how to use EJB 3.1 Timer (@Schedule and @Timeout) with the JBoss AS server.

Features used:

  • Usage of @Schedule
  • Usage of @Timeout

System requirements

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 6.1 or later.

All you need to build this project is Java 6.0 (Java SDK 1.6) or later, Maven 3.0 or later.

Configure Maven

If you have not yet done so, you must Configure Maven before testing the quickstarts.

Start the JBoss Server

  1. Open a command line and navigate to the root of the JBoss server directory.

  2. The following shows the command line to start the server:

     For Linux:   JBOSS_HOME/bin/standalone.sh
     For Windows: JBOSS_HOME\bin\standalone.bat
    

Build and Deploy the Quickstart

NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See Build and Deploy the Quickstarts for complete instructions and additional options.

  1. Make sure you have started the JBoss Application Server as described above.

  2. Open a command line and navigate to the root directory of this quickstart.

  3. Type this command to build and deploy the archive:

     mvn clean install jboss-as:deploy
    

This will deploy target/jboss-ejb-timer.war to the running instance of the server. To undeploy, use

    mvn jboss-as:undeploy

Access the application

This application only prints messages to stdout. To see it working, check the server log. You should see similar output:

...
18:33:36,004 INFO  [stdout] (EJB default - 7) Hi from the EJB timer example!
18:33:38,003 INFO  [stdout] (EJB default - 8) Hi from the EJB timer example!
18:33:40,002 INFO  [stdout] (EJB default - 9) Hi from the EJB timer example!
18:33:42,002 INFO  [stdout] (EJB default - 10) Hi from the EJB timer example!
18:33:44,003 INFO  [stdout] (EJB default - 1) Hi from the EJB timer example!
18:33:46,004 INFO  [stdout] (EJB default - 2) Hi from the EJB timer example!
18:33:48,003 INFO  [stdout] (EJB default - 3) Hi from the EJB timer example!
...

The parentheses contain name of thread executing the particular invocation. There are pre-created threads in thread pool, and they are rotated. Hence the changing number.

Undeploy the Archive

  1. Make sure you have started the JBoss Server as described above.

  2. Open a command line and navigate to the root directory of this quickstart.

  3. When you are finished testing, type this command to undeploy the archive:

     mvn jboss-as:undeploy
    

Debug the Application

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

    mvn dependency:sources
    mvn dependency:resolve -Dclassifier=javadoc

txremovalsample's People

Contributors

johnathonlee avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.