From ce73b9b61e21c5dfb2a5fe36bff2a8173141814c Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Mon, 4 Jan 2016 15:54:13 +0200 Subject: [PATCH] add HowdyGreeting in demo, a Greeting service implementation declared via Java Service Provider mechanism (META-INF/services) --- .../ro/fortsoft/pf4j/demo/HowdyGreeting.java | 32 +++++++++++++++++++ .../ro.fortsoft.pf4j.demo.api.Greeting | 1 + 2 files changed, 33 insertions(+) create mode 100644 demo/app/src/main/java/ro/fortsoft/pf4j/demo/HowdyGreeting.java create mode 100644 demo/app/src/main/resources/META-INF/services/ro.fortsoft.pf4j.demo.api.Greeting diff --git a/demo/app/src/main/java/ro/fortsoft/pf4j/demo/HowdyGreeting.java b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/HowdyGreeting.java new file mode 100644 index 0000000..3d7d24b --- /dev/null +++ b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/HowdyGreeting.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ro.fortsoft.pf4j.demo; + +import ro.fortsoft.pf4j.demo.api.Greeting; + +/** + * A Service Implementation (no @Extension) declared via Java Service Provider mechanism (using META-INF/services). + * + * @author Decebal Suiu + */ +public class HowdyGreeting implements Greeting { + + @Override + public String getGreeting() { + return "Howdy"; + } + +} diff --git a/demo/app/src/main/resources/META-INF/services/ro.fortsoft.pf4j.demo.api.Greeting b/demo/app/src/main/resources/META-INF/services/ro.fortsoft.pf4j.demo.api.Greeting new file mode 100644 index 0000000..4f8f4ad --- /dev/null +++ b/demo/app/src/main/resources/META-INF/services/ro.fortsoft.pf4j.demo.api.Greeting @@ -0,0 +1 @@ +ro.fortsoft.pf4j.demo.HowdyGreeting -- 2.39.5