You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/03/03 23:00:26 UTC
[isis] branch master updated: ISIS-1891 creating plugin interfaces
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new ed9c95a ISIS-1891 creating plugin interfaces
ed9c95a is described below
commit ed9c95a02c54a4485ee1f331b97164f7875bf1ad
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Mar 4 00:00:21 2018 +0100
ISIS-1891 creating plugin interfaces
---
.../applib/client/UriBuilderPlugin.java | 26 +++++++++++++++++++++
.../server/IsisJaxrsServerPlugin.java | 27 ++++++++++++++++++++++
2 files changed, 53 insertions(+)
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/UriBuilderPlugin.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/UriBuilderPlugin.java
new file mode 100644
index 0000000..63bf33b
--- /dev/null
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/UriBuilderPlugin.java
@@ -0,0 +1,26 @@
+package org.apache.isis.viewer.restfulobjects.applib.client;
+
+import javax.ws.rs.core.UriBuilder;
+
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.internal.context._Plugin;
+
+public interface UriBuilderPlugin {
+
+ // -- INTERFACE
+
+ public UriBuilder uriTemplate(String uriTemplate);
+
+ // -- LOOKUP
+
+ public static UriBuilderPlugin get() {
+ return _Plugin.getOrElse(UriBuilderPlugin.class,
+ ambigousPlugins->{
+ throw new NonRecoverableException("Ambigous plugins implementing UriBuilderPlugin found on class path.");
+ },
+ ()->{
+ throw new NonRecoverableException("No plugin implementing UriBuilderPlugin found on class path.");
+ });
+ }
+
+}
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/IsisJaxrsServerPlugin.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/IsisJaxrsServerPlugin.java
new file mode 100644
index 0000000..c09281d
--- /dev/null
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/IsisJaxrsServerPlugin.java
@@ -0,0 +1,27 @@
+package org.apache.isis.viewer.restfulobjects.server;
+
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.internal.context._Plugin;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+
+public interface IsisJaxrsServerPlugin {
+
+ // -- INTERFACE
+
+ public Object newRestfulObjectsJaxbWriterForXml();
+
+ public HttpStatusCode getFailureStatusCodeIfAny(Throwable ex);
+
+ // -- LOOKUP
+
+ public static IsisJaxrsServerPlugin get() {
+ return _Plugin.getOrElse(IsisJaxrsServerPlugin.class,
+ ambigousPlugins->{
+ throw new NonRecoverableException("Ambigous plugins implementing IsisJaxrsServerPlugin found on class path.");
+ },
+ ()->{
+ throw new NonRecoverableException("No plugin implementing IsisJaxrsServerPlugin found on class path.");
+ });
+ }
+
+}
--
To stop receiving notification emails like this one, please contact
ahuber@apache.org.