From 06e63fc1804d9128da35ddc465d804cbb979f459 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Tue, 27 Apr 2010 11:07:33 +0000 Subject: [PATCH] SWS-351 - Arbitrary parameter injection for @Endpoints --- .../endpoint/annotation/RequestPayload.java | 39 +++++++++++++++++++ .../endpoint/annotation/ResponsePayload.java | 39 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java create mode 100644 core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java diff --git a/core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java b/core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java new file mode 100644 index 00000000..9dec3c1a --- /dev/null +++ b/core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java @@ -0,0 +1,39 @@ +/* + * Copyright 2005-2010 the original author or authors. + * + * 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 org.springframework.ws.server.endpoint.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation which indicates that a method parameter should be bound to the {@linkplain + * org.springframework.ws.WebServiceMessage#getPayloadSource() request payload}. Supported for annotated endpoint + * methods. + * + * @author Arjen Poutsma + * @see ResponsePayload + * @since 2.0 + */ +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RequestPayload { + +} diff --git a/core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java b/core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java new file mode 100644 index 00000000..67ddf3a8 --- /dev/null +++ b/core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java @@ -0,0 +1,39 @@ +/* + * Copyright 2005-2010 the original author or authors. + * + * 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 org.springframework.ws.server.endpoint.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation which indicates that a method return value should be bound to the {@linkplain + * org.springframework.ws.WebServiceMessage#getPayloadSource() response payload}. Supported for annotated endpoint + * methods. + * + * @author Arjen Poutsma + * @see RequestPayload + * @since 2.0 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ResponsePayload { + +}