From acbda222cf825c545a13290d5fbdf06c5ce10b1c Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 15 Jan 2014 22:11:59 +0100 Subject: [PATCH] [New] Added dependency to li.strolch.rest --- pom.xml | 6 +++ .../postinitializer/PostInitializer.java | 8 +++- .../web/rest/RestfulApplication.java | 38 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/main/java/li/strolch/tutorialwebapp/web/rest/RestfulApplication.java diff --git a/pom.xml b/pom.xml index c56fd4573..91c4949f7 100644 --- a/pom.xml +++ b/pom.xml @@ -38,15 +38,21 @@ + li.strolch li.strolch.bom pom + + li.strolch + li.strolch.rest + li.strolch li.strolch.persistence.xml + org.slf4j slf4j-log4j12 diff --git a/src/main/java/li/strolch/tutorialwebapp/postinitializer/PostInitializer.java b/src/main/java/li/strolch/tutorialwebapp/postinitializer/PostInitializer.java index 724a4bef6..53a5d5d5d 100644 --- a/src/main/java/li/strolch/tutorialwebapp/postinitializer/PostInitializer.java +++ b/src/main/java/li/strolch/tutorialwebapp/postinitializer/PostInitializer.java @@ -17,6 +17,7 @@ package li.strolch.tutorialwebapp.postinitializer; import li.strolch.agent.impl.ComponentContainerImpl; import li.strolch.agent.impl.SimplePostInitializer; +import li.strolch.rest.inspector.AgentRef; /** * @author Robert von Burg @@ -34,9 +35,12 @@ public class PostInitializer extends SimplePostInitializer { @Override public void start() { - + + logger.info("Initializing RestfulServices..."); + AgentRef.getInstance().init(getContainer().getAgent()); + logger.info("Started PostInitializer."); //$NON-NLS-1$ - + super.start(); } } diff --git a/src/main/java/li/strolch/tutorialwebapp/web/rest/RestfulApplication.java b/src/main/java/li/strolch/tutorialwebapp/web/rest/RestfulApplication.java new file mode 100644 index 000000000..8f8060f22 --- /dev/null +++ b/src/main/java/li/strolch/tutorialwebapp/web/rest/RestfulApplication.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013 Robert von Burg + * + * 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 li.strolch.tutorialwebapp.web.rest; + +import java.util.HashSet; +import java.util.Set; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +import li.strolch.rest.inspector.StrolchRestfulClasses; + +/** + * @author Robert von Burg + */ +@ApplicationPath("rest") +public class RestfulApplication extends Application { + + @Override + public Set> getClasses() { + Set> classes = new HashSet<>(); + classes.addAll(StrolchRestfulClasses.getClasses()); + return classes; + } +}