Skip to content
A reliable asynchronous message used in single JVM.
Java
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.settings
src
.gitignore
Readme.md
pom.xml

Readme.md

Osprey

Osprey is a little java tool.

Osprey makes a way that you want execute something ultimately by persistent staffs in to file.

Dowload

QuikStart

public class OspreyManagerTest {

    public static void main(String[] args) {
//        BasicConfigurator.configure();
        OspreyManager ospreyManager = new OspreyManager("osprey-test");
        ospreyManager.registerProcessor(new TestProcessor());
        ospreyManager.init();
        Message message = new TestMessage();
        Result result = ospreyManager.addMessage(message, false);
        System.out.println(result.isSuccess());
        result = ospreyManager.commitMessage(message, result);
        System.out.println(result.isSuccess());
    }

    public static class TestMessage extends Message {

        private static final long serialVersionUID = -9006052790210673532L;

    }

    public static class TestProcessor implements OspreyProcessor<TestMessage> {

        /**
         * @return
         */
        public Class<TestMessage> interest() {
            return TestMessage.class;
        }

        /**
         * @param event
         * @return
         */
        public Result process(TestMessage event) {
            System.out.println("Handled event" + event);
            Result result = new Result();
            result.setSuccess(false);
            return result;
        }

    }

}
Something went wrong with that request. Please try again.