001/*
002 * jPOS Project [http://jpos.org]
003 * Copyright (C) 2000-2026 jPOS Software SRL
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jpos.jfr;
020
021import jdk.jfr.Category;
022import jdk.jfr.Event;
023import jdk.jfr.Name;
024import jdk.jfr.StackTrace;
025
026@Category("jPOS")
027@Name("jpos.TMEvent")
028@StackTrace()
029public class TMEvent extends Event {
030    @Name("name")
031    protected final String name;
032
033    @Name("id")
034    protected final long id;
035
036    public TMEvent(String name, long id) {
037        this.name = name;
038        this.id = id;
039    }
040    
041    @Name("jpos.TMPrepare")
042    public static class Prepare extends TMEvent {
043        public Prepare(String name, long id) {
044            super(name, id);
045        }
046    }
047
048    @Name("jpos.TMPrepareForAbort")
049    public static class PrepareForAbort extends TMEvent {
050        public PrepareForAbort(String name, long id) {
051            super(name, id);
052        }
053    }
054
055    @Name("jpos.TMCommit")
056    public static class Commit extends TMEvent {
057        public Commit(String name, long id) {
058            super(name, id);
059        }
060    }
061
062    @Name("jpos.TMAbort")
063    public static class Abort extends TMEvent {
064        public Abort(String name, long id) {
065            super(name, id);
066        }
067    }
068
069    @Name("jpos.TMSnapshot")
070    public static class Snapshot extends TMEvent {
071        public Snapshot(String name, long id) {
072            super(name, id);
073        }
074    }
075
076    @Name("jpos.TMPause")
077    public static class Pause extends TMEvent {
078        public Pause(String name, long id) {
079            super(name, id);
080        }
081    }
082    @Name("jpos.TMRecover")
083    public static class Recover extends TMEvent {
084        public Recover(String name, long id) {
085            super(name, id);
086        }
087    }
088
089}