Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A6A1200B25 for ; Wed, 8 Jun 2016 17:40:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 491BE160A2E; Wed, 8 Jun 2016 15:40:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1AE3D160A0E for ; Wed, 8 Jun 2016 17:40:41 +0200 (CEST) Received: (qmail 73688 invoked by uid 500); 8 Jun 2016 15:40:41 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 73679 invoked by uid 99); 8 Jun 2016 15:40:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2016 15:40:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2CE1DDFFD9; Wed, 8 Jun 2016 15:40:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <9dcfc60f6f2042298398f05c789322f3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Updating jaxrs_spring_boot demo to use an interface Date: Wed, 8 Jun 2016 15:40:41 +0000 (UTC) archived-at: Wed, 08 Jun 2016 15:40:43 -0000 Repository: cxf Updated Branches: refs/heads/master 9628872a1 -> b15472f1f Updating jaxrs_spring_boot demo to use an interface Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b15472f1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b15472f1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b15472f1 Branch: refs/heads/master Commit: b15472f1f6fd0ffe35a72f56b5b843e393320dcc Parents: 9628872 Author: Sergey Beryozkin Authored: Wed Jun 8 16:40:26 2016 +0100 Committer: Sergey Beryozkin Committed: Wed Jun 8 16:40:26 2016 +0100 ---------------------------------------------------------------------- .../samples/jax_rs/jaxrs_spring_boot/pom.xml | 6 --- .../rs/client/SampleRestClientApplication.java | 7 ++-- .../java/sample/rs/service/HelloService.java | 37 +++++++++++++++++ .../rs/service/SampleRestApplication.java | 6 +-- .../sample/rs/service/hello1/HelloService.java | 42 -------------------- .../rs/service/hello1/HelloServiceImpl1.java | 30 ++++++++++++++ .../sample/rs/service/hello2/HelloService2.java | 42 -------------------- .../rs/service/hello2/HelloServiceImpl2.java | 32 +++++++++++++++ .../sample/rs/service/hello1/HelloService.java | 42 -------------------- .../sample/rs/service/hello2/HelloService2.java | 42 -------------------- 10 files changed, 106 insertions(+), 180 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/pom.xml b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/pom.xml index 592e2f8..fa62e68 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/pom.xml @@ -37,12 +37,6 @@ - - cglib - cglib-nodep - 2.2.2 - - http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java index f015097..448861c 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java @@ -20,7 +20,7 @@ package sample.rs.client; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; -import sample.rs.service.hello1.HelloService; +import sample.rs.service.HelloService; public final class SampleRestClientApplication { @@ -28,8 +28,9 @@ public final class SampleRestClientApplication { } public static void main(String[] args) { - HelloService service = JAXRSClientFactory.create("http://localhost:8080/services/helloservice/", - HelloService.class); + HelloService service = + JAXRSClientFactory.create("http://localhost:8080/services/helloservice/", + HelloService.class); System.out.println(service.sayHello("ApacheCxfUser")); } } http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java new file mode 100644 index 0000000..bd37a96 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java @@ -0,0 +1,37 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 sample.rs.service; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.springframework.stereotype.Service; + +@Path("/sayHello") +@Service +public interface HelloService { + + @GET + @Path("/{a}") + @Produces(MediaType.TEXT_PLAIN) + String sayHello(@PathParam("a") String a); + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java index d2d241e..f739e95 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java @@ -28,8 +28,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import sample.rs.service.hello1.HelloService; -import sample.rs.service.hello2.HelloService2; +import sample.rs.service.hello1.HelloServiceImpl1; +import sample.rs.service.hello2.HelloServiceImpl2; @SpringBootApplication public class SampleRestApplication { @@ -44,7 +44,7 @@ public class SampleRestApplication { public Server rsServer() { JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean(); endpoint.setBus(bus); - endpoint.setServiceBeans(Arrays.asList(new HelloService(), new HelloService2())); + endpoint.setServiceBeans(Arrays.asList(new HelloServiceImpl1(), new HelloServiceImpl2())); endpoint.setAddress("/"); endpoint.setFeatures(Arrays.asList(new Swagger2Feature())); return endpoint.create(); http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloService.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloService.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloService.java deleted file mode 100644 index 6672ecb..0000000 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloService.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 sample.rs.service.hello1; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.springframework.stereotype.Service; - -import io.swagger.annotations.Api; - -@Path("/sayHello") -@Service -@Api("/sayHello") -public class HelloService { - - @GET - @Path("/{a}") - @Produces(MediaType.TEXT_PLAIN) - public String sayHello(@PathParam("a") String a) { - return "Hello " + a + ", Welcome to CXF RS Spring Boot World!!!"; - } - -} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloServiceImpl1.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloServiceImpl1.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloServiceImpl1.java new file mode 100644 index 0000000..0e5d9b8 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello1/HelloServiceImpl1.java @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 sample.rs.service.hello1; +import io.swagger.annotations.Api; +import sample.rs.service.HelloService; + +@Api("/sayHello") +public class HelloServiceImpl1 implements HelloService { + + public String sayHello(String a) { + return "Hello " + a + ", Welcome to CXF RS Spring Boot World!!!"; + } + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloService2.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloService2.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloService2.java deleted file mode 100644 index 874e363..0000000 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloService2.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 sample.rs.service.hello2; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.springframework.stereotype.Service; - -import io.swagger.annotations.Api; - -@Path("/sayHello2") -@Service -@Api("/sayHello2") -public class HelloService2 { - - @GET - @Path("/{a}") - @Produces(MediaType.TEXT_PLAIN) - public String sayHello(@PathParam("a") String a) { - return "Hello2 " + a + ", Welcome to CXF RS Spring Boot World!!!"; - } - -} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloServiceImpl2.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloServiceImpl2.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloServiceImpl2.java new file mode 100644 index 0000000..9b24c29 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/hello2/HelloServiceImpl2.java @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 sample.rs.service.hello2; +import javax.ws.rs.Path; + +import io.swagger.annotations.Api; +import sample.rs.service.HelloService; +@Path("/sayHello2") +@Api("/sayHello2") +public class HelloServiceImpl2 implements HelloService { + + public String sayHello(String a) { + return "Hello2 " + a + ", Welcome to CXF RS Spring Boot World!!!"; + } + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello1/HelloService.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello1/HelloService.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello1/HelloService.java deleted file mode 100644 index 6672ecb..0000000 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello1/HelloService.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 sample.rs.service.hello1; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.springframework.stereotype.Service; - -import io.swagger.annotations.Api; - -@Path("/sayHello") -@Service -@Api("/sayHello") -public class HelloService { - - @GET - @Path("/{a}") - @Produces(MediaType.TEXT_PLAIN) - public String sayHello(@PathParam("a") String a) { - return "Hello " + a + ", Welcome to CXF RS Spring Boot World!!!"; - } - -} http://git-wip-us.apache.org/repos/asf/cxf/blob/b15472f1/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello2/HelloService2.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello2/HelloService2.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello2/HelloService2.java deleted file mode 100644 index 874e363..0000000 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/hello2/HelloService2.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 sample.rs.service.hello2; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.springframework.stereotype.Service; - -import io.swagger.annotations.Api; - -@Path("/sayHello2") -@Service -@Api("/sayHello2") -public class HelloService2 { - - @GET - @Path("/{a}") - @Produces(MediaType.TEXT_PLAIN) - public String sayHello(@PathParam("a") String a) { - return "Hello2 " + a + ", Welcome to CXF RS Spring Boot World!!!"; - } - -}