23 | * curl -d "sentence=Hello world" http://localhost:8080/translate 24 | *25 | * 26 | * @author Martin Kouba 27 | */ 28 | public class TranslatorExampleRunner { 29 | 30 | public static void main(String[] args) { 31 | Vertx.vertx().deployVerticle(new TranslatorVerticle()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /web/src/test/java/org/jboss/weld/vertx/web/HelloHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2016, Red Hat, Inc., and individual contributors 4 | * by the @authors tag. See the copyright.txt in the distribution for a 5 | * full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.weld.vertx.web; 18 | 19 | import javax.inject.Inject; 20 | 21 | import io.vertx.core.Handler; 22 | import io.vertx.ext.web.RoutingContext; 23 | 24 | @WebRoute("/hello") 25 | public class HelloHandler implements Handler
31 | * This annotation is annotated with {@link Stereotype} to workaround the limitations of the annotated bean discovery mode.
32 | *
33 | * @author Martin Kouba
34 | */
35 | @Retention(RUNTIME)
36 | @Target({ TYPE, METHOD })
37 | @Stereotype
38 | public @interface WebRoutes {
39 |
40 | WebRoute[] value();
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/examples/translator/src/main/java/org/jboss/weld/vertx/examples/translator/SimpleSentenceParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source
3 | * Copyright 2016, Red Hat, Inc., and individual contributors
4 | * by the @authors tag. See the copyright.txt in the distribution for a
5 | * full listing of individual contributors.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.jboss.weld.vertx.examples.translator;
18 |
19 | import java.util.Arrays;
20 | import java.util.List;
21 |
22 | import javax.enterprise.context.Dependent;
23 |
24 | import io.vertx.core.logging.Logger;
25 | import io.vertx.core.logging.LoggerFactory;
26 |
27 | /**
28 | *
29 | * @author Martin Kouba
30 | */
31 | @Dependent
32 | public class SimpleSentenceParser implements SentenceParser {
33 |
34 | private static final Logger LOGGER = LoggerFactory.getLogger(SimpleSentenceParser.class.getName());
35 |
36 | @Override
37 | public List> unsatisfied;
40 |
41 | @Inject
42 | AsyncReference