34 |
--------------------------------------------------------------------------------
/meecrowave-doc/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
7 | ----
8 |
9 | This product bundles Pretty Doc theme:
10 |
11 | Template Name: PrettyDocs - Responsive Website Template for documentations
12 | Version: 1.0
13 | Author: Xiaoying Riley
14 | License: Creative Commons Attribution 3.0 License - https://creativecommons.org/licenses/by/3.0/
15 | Twitter: @3rdwave_themes
16 | Website: http://themes.3rdwavemedia.com/
17 |
18 | ----
19 |
20 | This product bundles Twitter Bootstrap:
21 |
22 | Bootstrap v3.3.6 (http://getbootstrap.com)
23 | Copyright 2011-2015 Twitter, Inc.
24 | Licensed under the MIT license
25 |
26 | ----
27 |
28 | This product bundles Elegant font:
29 |
30 | https://www.elegantthemes.com/blog/resources/elegant-icon-font
31 | Licensed under the MIT license
32 |
33 | ----
34 |
35 | This product bundles font awesome:
36 |
37 | Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome
38 | License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
39 |
40 | ----
41 |
42 | This product bundles jQuery match height:
43 |
44 | jquery.matchHeight-min.js v0.5.2
45 | http://brm.io/jquery-match-height/
46 | License: MIT
47 |
48 | ----
49 |
50 | This product bundles jQuery:
51 |
52 | jQuery v1.12.3 | (c) jQuery Foundation | jquery.org/license
53 |
54 |
--------------------------------------------------------------------------------
/meecrowave-gradle-plugin/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/meecrowave-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.apache.meecrowave.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
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 | implementation-class=org.apache.meecrowave.gradle.MeecrowavePlugin
18 |
--------------------------------------------------------------------------------
/meecrowave-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.apache.microwave.microwave.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
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 | implementation-class=org.apache.meecrowave.gradle.MeecrowavePlugin
18 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/EntityManagerScoped.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.api;
20 |
21 | import jakarta.enterprise.context.NormalScope;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.Target;
24 |
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.TYPE;
27 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
28 |
29 | @NormalScope
30 | @Target({METHOD, TYPE})
31 | @Retention(RUNTIME)
32 | public @interface EntityManagerScoped {
33 | }
34 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/Jpa.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.api;
20 |
21 | import jakarta.interceptor.InterceptorBinding;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.Target;
24 |
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.TYPE;
27 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
28 |
29 | @InterceptorBinding
30 | @Target({METHOD, TYPE})
31 | @Retention(RUNTIME)
32 | public @interface Jpa {
33 | boolean transactional() default true;
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/Unit.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.api;
20 |
21 | import jakarta.inject.Qualifier;
22 | import jakarta.persistence.SynchronizationType;
23 | import java.lang.annotation.Retention;
24 | import java.lang.annotation.Target;
25 |
26 | import static java.lang.annotation.ElementType.FIELD;
27 | import static java.lang.annotation.ElementType.METHOD;
28 | import static java.lang.annotation.ElementType.PARAMETER;
29 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
30 |
31 | @Qualifier
32 | @Target({FIELD, METHOD, PARAMETER})
33 | @Retention(RUNTIME)
34 | public @interface Unit {
35 | String name();
36 | SynchronizationType synchronization() default SynchronizationType.SYNCHRONIZED;
37 | }
38 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/AnyLiteral.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.internal;
20 |
21 | import jakarta.enterprise.inject.Any;
22 | import jakarta.enterprise.util.AnnotationLiteral;
23 | import java.lang.annotation.Annotation;
24 |
25 | public class AnyLiteral extends AnnotationLiteral
implements Any {
26 | public static final AnyLiteral INSTANCE = new AnyLiteral();
27 |
28 | private static final String TOSTRING = "@javax.enterprise.inject.Any()";
29 | private static final long serialVersionUID = -8922048102786275371L;
30 |
31 | @Override
32 | public Class extends Annotation> annotationType() {
33 | return Any.class;
34 | }
35 |
36 | @Override
37 | public boolean equals(final Object other) {
38 | return Any.class.isInstance(other)
39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType());
40 | }
41 |
42 | @Override
43 | public int hashCode() {
44 | return 0;
45 | }
46 |
47 | @Override
48 | public String toString() {
49 | return TOSTRING;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaInterceptorBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.internal;
20 |
21 | import jakarta.inject.Inject;
22 | import jakarta.interceptor.AroundInvoke;
23 | import jakarta.interceptor.InvocationContext;
24 | import java.io.Serializable;
25 |
26 | public abstract class JpaInterceptorBase implements Serializable {
27 | @Inject
28 | private JpaExtension extension;
29 |
30 | @AroundInvoke
31 | public Object inTransaction(final InvocationContext context) throws Exception {
32 | final EntityManagerContext entityManagerContext = extension.getEntityManagerContext();
33 | final boolean owner = entityManagerContext.enter(isTransactional());
34 | try {
35 | return context.proceed();
36 | } catch (final Exception e) {
37 | entityManagerContext.failed();
38 | throw e;
39 | } finally {
40 | entityManagerContext.exit(owner);
41 | }
42 | }
43 |
44 | protected abstract boolean isTransactional();
45 | }
46 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaLiteral.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.internal;
20 |
21 | import org.apache.meecrowave.jpa.api.Jpa;
22 |
23 | import jakarta.enterprise.util.AnnotationLiteral;
24 | import java.lang.annotation.Annotation;
25 |
26 | class JpaLiteral extends AnnotationLiteral implements Jpa {
27 | public static final Annotation DEFAULT = new JpaLiteral(true);
28 |
29 | private final boolean transactional;
30 | private final int hash;
31 |
32 | JpaLiteral(final boolean transactional) {
33 | this.transactional = transactional;
34 | this.hash = hashCode();
35 | }
36 |
37 | @Override
38 | public Class extends Annotation> annotationType() {
39 | return Jpa.class;
40 | }
41 |
42 | @Override
43 | public boolean transactional() {
44 | return transactional;
45 | }
46 |
47 | @Override
48 | public boolean equals(final Object other) {
49 | return Jpa.class.isInstance(other) && Jpa.class.cast(other).transactional() == transactional;
50 | }
51 |
52 | @Override
53 | public int hashCode() {
54 | return hash;
55 | }
56 |
57 | @Override
58 | public String toString() {
59 | return "@Jpa(transactional)" + transactional + ")";
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaNoTransactionInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.internal;
20 |
21 | import org.apache.meecrowave.jpa.api.Jpa;
22 |
23 | import jakarta.annotation.Priority;
24 | import jakarta.interceptor.Interceptor;
25 |
26 | @Jpa(transactional = false)
27 | @Interceptor
28 | @Priority(Interceptor.Priority.LIBRARY_BEFORE)
29 | public class JpaNoTransactionInterceptor extends JpaInterceptorBase {
30 | @Override
31 | protected boolean isTransactional() {
32 | return false;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaTransactionInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jpa.internal;
20 |
21 | import org.apache.meecrowave.jpa.api.Jpa;
22 |
23 | import jakarta.annotation.Priority;
24 | import jakarta.interceptor.Interceptor;
25 |
26 | @Jpa
27 | @Interceptor
28 | @Priority(Interceptor.Priority.LIBRARY_BEFORE)
29 | public class JpaTransactionInterceptor extends JpaInterceptorBase {
30 | @Override
31 | protected boolean isTransactional() {
32 | return true;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/UnitLiteral.java:
--------------------------------------------------------------------------------
1 | package org.apache.meecrowave.jpa.internal;
2 |
3 | import org.apache.meecrowave.jpa.api.Unit;
4 |
5 | import jakarta.enterprise.util.AnnotationLiteral;
6 | import jakarta.persistence.SynchronizationType;
7 |
8 | class UnitLiteral extends AnnotationLiteral implements Unit {
9 | private final String name;
10 | private final SynchronizationType synchronization;
11 |
12 | UnitLiteral(final String name, final SynchronizationType synchronization) {
13 | this.name = name;
14 | this.synchronization = synchronization;
15 | }
16 |
17 | @Override
18 | public String name() {
19 | return name;
20 | }
21 |
22 | @Override
23 | public SynchronizationType synchronization() {
24 | return synchronization;
25 | }
26 |
27 | @Override
28 | public boolean equals(final Object o) {
29 | if (this == o) {
30 | return true;
31 | }
32 | if (o == null || getClass() != o.getClass()) {
33 | return false;
34 | }
35 | final UnitLiteral that = UnitLiteral.class.cast(o);
36 | return name.equals(that.name) && synchronization.equals(that.synchronization);
37 |
38 | }
39 |
40 | @Override
41 | public int hashCode() {
42 | return name.hashCode() + 31 * synchronization.hashCode();
43 | }
44 |
45 | @Override
46 | public String toString() {
47 | return "@Unit(name=" + name + ",synchronization=" + synchronization.name() + ")";
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.jpa.internal.JpaExtension
2 |
--------------------------------------------------------------------------------
/meecrowave-jpa/src/test/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
--------------------------------------------------------------------------------
/meecrowave-jta/src/main/java/org/apache/meecrowave/jta/AnyLiteral.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jta;
20 |
21 | import jakarta.enterprise.inject.Any;
22 | import jakarta.enterprise.util.AnnotationLiteral;
23 | import java.lang.annotation.Annotation;
24 |
25 | public class AnyLiteral extends AnnotationLiteral implements Any {
26 | public static final AnyLiteral INSTANCE = new AnyLiteral();
27 |
28 | private static final String TOSTRING = "@javax.enterprise.inject.Any()";
29 | private static final long serialVersionUID = -8922048102786275371L;
30 |
31 | @Override
32 | public Class extends Annotation> annotationType() {
33 | return Any.class;
34 | }
35 |
36 | @Override
37 | public boolean equals(final Object other) {
38 | return Any.class.isInstance(other)
39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType());
40 | }
41 |
42 | @Override
43 | public int hashCode() {
44 | return 0;
45 | }
46 |
47 | @Override
48 | public String toString() {
49 | return TOSTRING;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/meecrowave-jta/src/main/java/org/apache/meecrowave/jta/DefaultLiteral.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF Default
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.jta;
20 |
21 | import jakarta.enterprise.inject.Default;
22 | import jakarta.enterprise.util.AnnotationLiteral;
23 | import java.lang.annotation.Annotation;
24 |
25 | public class DefaultLiteral extends AnnotationLiteral implements Default {
26 | public static final DefaultLiteral INSTANCE = new DefaultLiteral();
27 |
28 | private static final String TOSTRING = "@javax.enterprise.inject.Default()";
29 | private static final long serialVersionUID = -8922048102786275371L;
30 |
31 | @Override
32 | public Class extends Annotation> annotationType() {
33 | return Default.class;
34 | }
35 |
36 | @Override
37 | public boolean equals(final Object other) {
38 | return Default.class.isInstance(other)
39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType());
40 | }
41 |
42 | @Override
43 | public int hashCode() {
44 | return 0;
45 | }
46 |
47 | @Override
48 | public String toString() {
49 | return TOSTRING;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/meecrowave-jta/src/main/java/org/apache/meecrowave/jta/JtaConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
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.apache.meecrowave.jta;
18 |
19 | import org.apache.meecrowave.runner.cli.CliOption;
20 |
21 | public class JtaConfig {
22 | @CliOption(name = "jta-handle-exception-only-for-client", description = "should JTA exception only be managed by client")
23 | boolean handleExceptionOnlyForClient;
24 |
25 | public boolean isHandleExceptionOnlyForClient() {
26 | return handleExceptionOnlyForClient;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/meecrowave-jta/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.jta.JtaExtension
2 |
--------------------------------------------------------------------------------
/meecrowave-jta/src/test/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/AfterFirstInjection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static java.lang.annotation.ElementType.METHOD;
22 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
23 |
24 | import java.lang.annotation.Retention;
25 | import java.lang.annotation.Target;
26 |
27 | /**
28 | * Called after the first injection.
29 | * This is a kind of @BeforeAll but after injections with test instance (method is not static).
30 | */
31 | @Target(METHOD)
32 | @Retention(RUNTIME)
33 | public @interface AfterFirstInjection {
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/AfterLastTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static java.lang.annotation.ElementType.METHOD;
22 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
23 |
24 | import java.lang.annotation.Retention;
25 | import java.lang.annotation.Target;
26 |
27 | /**
28 | * Called after the last test.
29 | * This is a kind of @AfterAll but with test instance (method is not static).
30 | */
31 | @Target(METHOD)
32 | @Retention(RUNTIME)
33 | public @interface AfterLastTest {
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/MonoMeecrowaveConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import org.junit.jupiter.api.extension.ExtendWith;
22 |
23 | import java.lang.annotation.Retention;
24 | import java.lang.annotation.Target;
25 |
26 | import static java.lang.annotation.ElementType.TYPE;
27 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
28 |
29 | @Target(TYPE)
30 | @Retention(RUNTIME)
31 | @ExtendWith(MonoMeecrowaveExtension.class)
32 | public @interface MonoMeecrowaveConfig {
33 | // no config since it is shared
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/Scopes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static java.lang.annotation.ElementType.METHOD;
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
24 |
25 | import java.lang.annotation.Annotation;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | import org.junit.jupiter.api.extension.ExtendWith;
30 |
31 | @Target({TYPE, METHOD})
32 | @Retention(RUNTIME)
33 | @ExtendWith(ScopesExtension.class)
34 | public @interface Scopes {
35 | Class extends Annotation>[] scopes() default {};
36 | }
37 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/java/org/apache/meecrowave/testing/ConfigurationInject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.testing;
20 |
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.Target;
23 |
24 | import static java.lang.annotation.ElementType.FIELD;
25 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
26 |
27 | @Target(FIELD)
28 | @Retention(RUNTIME)
29 | public @interface ConfigurationInject {
30 | }
31 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigMetaAnnotationTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static org.junit.Assert.assertTrue;
22 |
23 | import jakarta.enterprise.context.RequestScoped;
24 |
25 | import org.apache.webbeans.config.WebBeansContext;
26 | import org.junit.jupiter.api.Test;
27 |
28 | @MeecrowaveRequestScopedConfig
29 | class MeecrowaveConfigMetaAnnotationTest {
30 | @Test
31 | void run() {
32 | assertTrue(WebBeansContext.currentInstance().getContextsService().getCurrentContext(RequestScoped.class, false).isActive());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigScopesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static org.junit.Assert.assertTrue;
22 |
23 | import jakarta.enterprise.context.RequestScoped;
24 |
25 | import org.apache.webbeans.config.WebBeansContext;
26 | import org.junit.jupiter.api.Test;
27 |
28 | @MeecrowaveConfig(scopes = RequestScoped.class)
29 | class MeecrowaveConfigScopesTest {
30 | @Test
31 | void run() {
32 | assertTrue(WebBeansContext.currentInstance().getContextsService().getCurrentContext(RequestScoped.class, false).isActive());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import org.apache.meecrowave.Meecrowave;
22 | import org.apache.meecrowave.io.IO;
23 | import org.apache.meecrowave.testing.ConfigurationInject;
24 | import org.junit.jupiter.api.Test;
25 |
26 | import java.io.IOException;
27 | import java.io.InputStream;
28 | import java.net.MalformedURLException;
29 | import java.net.URL;
30 |
31 | import static org.junit.Assert.assertEquals;
32 | import static org.junit.Assert.fail;
33 |
34 | @MeecrowaveConfig
35 | class MeecrowaveConfigTest {
36 | @ConfigurationInject
37 | private Meecrowave.Builder config;
38 |
39 | @Test
40 | void run() throws MalformedURLException {
41 | assertEquals("simple", slurp(new URL("http://localhost:" + config.getHttpPort() + "/api/test")));
42 | }
43 |
44 | private String slurp(final URL url) {
45 | try (final InputStream is = url.openStream()) {
46 | return IO.toString(is);
47 | } catch (final IOException e) {
48 | fail(e.getMessage());
49 | }
50 | return null;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveRequestScopedConfig.java:
--------------------------------------------------------------------------------
1 | package org.apache.meecrowave.junit5;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | import jakarta.enterprise.context.RequestScoped;
7 |
8 | import org.junit.platform.commons.annotation.Testable;
9 |
10 | @Testable
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @MeecrowaveConfig(scopes = RequestScoped.class)
13 | public @interface MeecrowaveRequestScopedConfig {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/ScopesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5;
20 |
21 | import static org.junit.Assert.assertNull;
22 | import static org.junit.Assert.assertTrue;
23 |
24 | import jakarta.enterprise.context.RequestScoped;
25 | import jakarta.enterprise.context.spi.Context;
26 |
27 | import org.apache.webbeans.config.WebBeansContext;
28 | import org.junit.jupiter.api.Test;
29 |
30 | @MonoMeecrowaveConfig
31 | @Scopes(scopes = RequestScoped.class)
32 | class ScopesTest {
33 | @Test
34 | @Scopes
35 | void overrided() {
36 | assertNull(getContext());
37 | }
38 |
39 | @Test
40 | void clazz() {
41 | assertTrue(getContext().isActive());
42 | }
43 |
44 | private Context getContext() {
45 | return WebBeansContext.currentInstance()
46 | .getContextsService()
47 | .getCurrentContext(RequestScoped.class, false);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/bean/Appender.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.junit5.bean;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 |
23 | @ApplicationScoped
24 | public class Appender {
25 | private String value;
26 |
27 | public void append(final String value) {
28 | this.value = (this.value != null ? this.value + '/' : "") + value;
29 | }
30 |
31 | public String get() {
32 | return value;
33 | }
34 |
35 | public void reset() {
36 | value = null;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/bean/SomeCommonInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
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.apache.meecrowave.junit5.bean;
18 |
19 | /**
20 | * Common interface to check whether Beans are really only picked up per class
21 | */
22 | public interface SomeCommonInterface {
23 | int meaningOfLife();
24 | }
25 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/app/Endpoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 | import jakarta.inject.Inject;
23 | import jakarta.ws.rs.GET;
24 | import jakarta.ws.rs.Path;
25 | import jakarta.ws.rs.Produces;
26 | import jakarta.ws.rs.core.MediaType;
27 |
28 | @Path("test")
29 | @ApplicationScoped
30 | public class Endpoint {
31 | @Inject
32 | private Injectable injectable;
33 |
34 | @GET
35 | @Produces(MediaType.TEXT_PLAIN)
36 | public String simple() {
37 | return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail";
38 | }
39 |
40 | @GET
41 | @Path("json")
42 | @Produces(MediaType.APPLICATION_JSON)
43 | public Simple json() {
44 | return new Simple("test");
45 | }
46 |
47 | public static class Simple {
48 | private String name;
49 |
50 | public Simple() {
51 | // no-op
52 | }
53 |
54 | public Simple(final String name) {
55 | this.name = name;
56 | }
57 |
58 | public String getName() {
59 | return name;
60 | }
61 |
62 | public void setName(final String name) {
63 | this.name = name;
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/app/Injectable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 |
23 | @ApplicationScoped
24 | public class Injectable {
25 | public String injected() {
26 | return "true";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/app/MyAppClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
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.app;
18 |
19 | import jakarta.enterprise.context.ApplicationScoped;
20 |
21 | /**
22 | * @author Mark Struberg
23 | */
24 | @ApplicationScoped
25 | public class MyAppClass {
26 | private String x = "init";
27 |
28 | public String getX() {
29 | return x;
30 | }
31 |
32 | public void setX(String x) {
33 | this.x = x;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/app/MyReqClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
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.app;
18 |
19 | import jakarta.enterprise.context.RequestScoped;
20 |
21 | /**
22 | * @author Mark Struberg
23 | */
24 | @RequestScoped
25 | public class MyReqClass {
26 | private String x = "init";
27 |
28 | public String getX() {
29 | return x;
30 | }
31 |
32 | public void setX(String x) {
33 | this.x = x;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/java/org/app/RsApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.Dependent;
22 | import jakarta.ws.rs.ApplicationPath;
23 | import jakarta.ws.rs.core.Application;
24 |
25 | @Dependent
26 | @ApplicationPath("api")
27 | public class RsApp extends Application {
28 | }
29 |
--------------------------------------------------------------------------------
/meecrowave-junit/src/test/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-junit/src/test/resources/META-INF/beans.xml
--------------------------------------------------------------------------------
/meecrowave-letsencrypt/src/main/resources/META-INF/services/org.apache.meecrowave.runner.Cli$Options:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.letencrypt.LetsEncryptReloadLifecycle$LetsEncryptConfig
2 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBakeMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.maven;
20 |
21 | import org.apache.maven.plugins.annotations.Mojo;
22 |
23 | import static org.apache.maven.plugins.annotations.ResolutionScope.RUNTIME_PLUS_SYSTEM;
24 |
25 | /**
26 | * Just an alias for run Mojo.
27 | */
28 | @Mojo(name = "bake", requiresDependencyResolution = RUNTIME_PLUS_SYSTEM)
29 | public class MeecrowaveBakeMojo extends MeecrowaveRunMojo {
30 | }
31 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/main/resources/bin/catalina.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | # -----------------------------------------------------------------------------
19 | # Plain copy of Tomcat with the script (EXECUTABLE) replacement
20 | # -----------------------------------------------------------------------------
21 |
22 | # Better OS/400 detection: see Bugzilla 31132
23 | os400=false
24 | case "`uname`" in
25 | OS400*) os400=true;;
26 | esac
27 |
28 | # resolve links - $0 may be a softlink
29 | PRG="$0"
30 |
31 | while [ -h "$PRG" ] ; do
32 | ls=`ls -ld "$PRG"`
33 | link=`expr "$ls" : '.*-> \(.*\)$'`
34 | if expr "$link" : '/.*' > /dev/null; then
35 | PRG="$link"
36 | else
37 | PRG=`dirname "$PRG"`/"$link"
38 | fi
39 | done
40 |
41 | PRGDIR=`dirname "$PRG"`
42 | EXECUTABLE=meecrowave.sh
43 |
44 | if $os400; then
45 | eval
46 | else
47 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
48 | echo "Cannot find $PRGDIR/$EXECUTABLE"
49 | echo "The file is absent or does not have execute permission"
50 | echo "This file is needed to run this program"
51 | exit 1
52 | fi
53 | fi
54 |
55 | exec "$PRGDIR"/"$EXECUTABLE" "$@"
56 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/main/resources/bin/shutdown.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | # -----------------------------------------------------------------------------
19 | # Plain copy of Tomcat with the script (EXECUTABLE) replacement
20 | # -----------------------------------------------------------------------------
21 |
22 | # Better OS/400 detection: see Bugzilla 31132
23 | os400=false
24 | case "`uname`" in
25 | OS400*) os400=true;;
26 | esac
27 |
28 | # resolve links - $0 may be a softlink
29 | PRG="$0"
30 |
31 | while [ -h "$PRG" ] ; do
32 | ls=`ls -ld "$PRG"`
33 | link=`expr "$ls" : '.*-> \(.*\)$'`
34 | if expr "$link" : '/.*' > /dev/null; then
35 | PRG="$link"
36 | else
37 | PRG=`dirname "$PRG"`/"$link"
38 | fi
39 | done
40 |
41 | PRGDIR=`dirname "$PRG"`
42 | EXECUTABLE=meecrowave.sh
43 |
44 | if $os400; then
45 | eval
46 | else
47 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
48 | echo "Cannot find $PRGDIR/$EXECUTABLE"
49 | echo "The file is absent or does not have execute permission"
50 | echo "This file is needed to run this program"
51 | exit 1
52 | fi
53 | fi
54 |
55 | exec "$PRGDIR"/"$EXECUTABLE" stop "$@"
56 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/main/resources/bin/startup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | # -----------------------------------------------------------------------------
19 | # Plain copy of Tomcat, you can just replace it and customize EXECUTABLE value
20 | # -----------------------------------------------------------------------------
21 |
22 | os400=false
23 | case "`uname`" in
24 | OS400*) os400=true;;
25 | esac
26 |
27 | PRG="$0"
28 |
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`/"$link"
36 | fi
37 | done
38 |
39 | PRGDIR=`dirname "$PRG"`
40 | EXECUTABLE=meecrowave.sh
41 |
42 | # Check that target executable exists
43 | if $os400; then
44 | eval
45 | else
46 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
47 | echo "Cannot find $PRGDIR/$EXECUTABLE"
48 | echo "The file is absent or does not have execute permission"
49 | echo "This file is needed to run this program"
50 | exit 1
51 | fi
52 | fi
53 |
54 | exec "$PRGDIR"/"$EXECUTABLE" start "$@"
55 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/java/org/app/AdditionalEndpoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 | import jakarta.ws.rs.GET;
23 | import jakarta.ws.rs.Path;
24 | import jakarta.ws.rs.Produces;
25 | import jakarta.ws.rs.core.MediaType;
26 |
27 | @Path("additional")
28 | @ApplicationScoped
29 | public class AdditionalEndpoint {
30 |
31 | @GET
32 | @Produces(MediaType.TEXT_PLAIN)
33 | public String available() {
34 | return "available";
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 | import jakarta.inject.Inject;
23 | import jakarta.ws.rs.GET;
24 | import jakarta.ws.rs.Path;
25 | import jakarta.ws.rs.Produces;
26 | import jakarta.ws.rs.core.MediaType;
27 |
28 | @Path("test")
29 | @ApplicationScoped
30 | public class Endpoint {
31 | @Inject
32 | private Injectable injectable;
33 |
34 | @GET
35 | @Produces(MediaType.TEXT_PLAIN)
36 | public String simple() {
37 | return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail";
38 | }
39 |
40 | @GET
41 | @Path("/model")
42 | @Produces(MediaType.APPLICATION_JSON)
43 | public Model simpleJsonModel() {
44 | Model model = new Model();
45 | model.setFirstName("firstname");
46 | return model;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/java/org/app/Injectable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 |
23 | @ApplicationScoped
24 | public class Injectable {
25 | public String injected() {
26 | return "true";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/java/org/app/Model.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | public class Model {
22 |
23 | private String firstName;
24 | private String lastName;
25 |
26 | public String getFirstName() {
27 | return firstName;
28 | }
29 |
30 | public void setFirstName(String firstName) {
31 | this.firstName = firstName;
32 | }
33 |
34 | public String getLastName() {
35 | return lastName;
36 | }
37 |
38 | public void setLastName(String lastName) {
39 | this.lastName = lastName;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/java/org/app/RsApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.app;
20 |
21 | import jakarta.enterprise.context.Dependent;
22 | import jakarta.ws.rs.ApplicationPath;
23 | import jakarta.ws.rs.core.Application;
24 |
25 | @Dependent
26 | @ApplicationPath("api")
27 | public class RsApp extends Application {
28 | }
29 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/resources/MeecrowaveBundleMojoTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
25 | 4.0.0
26 |
27 | org.apache.meecrowave.test
28 | test
29 | 0.1-SNAPSHOT
30 |
31 |
32 |
33 |
34 | org.apache.meecrowave
35 | meecrowave-maven-plugin
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/resources/MeecrowaveBundleMojoTest/src/main/webapp/sub/index.html:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 | Bundled
22 |
23 |
24 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/resources/MeecrowaveRunMojoTest/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
25 | 4.0.0
26 |
27 | org.apache.meecrowave.test
28 | test
29 | 0.1-SNAPSHOT
30 |
31 |
32 |
33 |
34 | org.apache.meecrowave
35 | meecrowave-maven-plugin
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/resources/MeecrowaveRunMojoTest/src/main/webapp/sub/index.html:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 | yes
22 |
23 |
24 |
--------------------------------------------------------------------------------
/meecrowave-maven-plugin/src/test/resources/meecrowave.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | jsonb-naming-strategy = LOWER_CASE_WITH_UNDERSCORES
19 | jsonb-nulls = true
20 |
--------------------------------------------------------------------------------
/meecrowave-oauth2-minimal/src/main/java/org/apache/meecrowave/oauth2/provider/JCacheCodeDataProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.oauth2.provider;
20 |
21 | import org.apache.cxf.Bus;
22 | import org.apache.meecrowave.oauth2.configuration.OAuth2Options;
23 |
24 | import jakarta.enterprise.inject.Vetoed;
25 |
26 | @Vetoed
27 | public class JCacheCodeDataProvider extends org.apache.cxf.rs.security.oauth2.grants.code.JCacheCodeDataProvider {
28 | public JCacheCodeDataProvider(final OAuth2Options configuration, final Bus bus) throws Exception {
29 | super(configuration.getJcacheConfigUri(), bus);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/meecrowave-oauth2-minimal/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Meecrowave
2 | Copyright 2016-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
7 | ---
8 |
9 | OpenJPA includes software developed by the SERP project
10 | Copyright (c) 2002-2006, A. Abram White. All rights reserved.
11 |
12 | ---
13 |
14 | OpenJPA includes the persistence and orm schemas from the JPA specifications.
15 | Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
16 |
17 | ---
18 |
19 | OpenJPA includes software written by Miroslav Nachev
20 |
--------------------------------------------------------------------------------
/meecrowave-oauth2-minimal/src/main/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/meecrowave-oauth2-minimal/src/main/resources/META-INF/services/org.apache.meecrowave.runner.Cli$Options:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.oauth2.configuration.OAuth2Options
2 |
--------------------------------------------------------------------------------
/meecrowave-oauth2-minimal/src/main/resources/default-oauth2.jcs:
--------------------------------------------------------------------------------
1 | #Licensed to the Apache Software Foundation (ASF) under one
2 | #or more contributor license agreements. See the NOTICE file
3 | #distributed with this work for additional information
4 | #regarding copyright ownership. The ASF licenses this file
5 | #to you under the Apache License, Version 2.0 (the
6 | #"License"); you may not use this file except in compliance
7 | #with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | #Unless required by applicable law or agreed to in writing,
12 | #software distributed under the License is distributed on an
13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | #KIND, either express or implied. See the License for the
15 | #specific language governing permissions and limitations
16 | #under the License.
17 | jcs.default=
18 | jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
19 | jcs.default.cacheattributes.MaxObjects=200001
20 | jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
21 | jcs.default.cacheattributes.UseMemoryShrinker=true
22 | jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
23 | jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
24 | jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
25 | jcs.default.elementattributes.IsEternal=false
26 | jcs.default.elementattributes.MaxLife=700
27 | jcs.default.elementattributes.IdleTime=1800
28 | jcs.default.elementattributes.IsSpool=true
29 | jcs.default.elementattributes.IsRemote=true
30 | jcs.default.elementattributes.IsLateral=true
31 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/AfterResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event;
20 |
21 | import jakarta.servlet.http.HttpServletRequest;
22 | import jakarta.servlet.http.HttpServletResponse;
23 |
24 | import org.apache.meecrowave.proxy.servlet.configuration.Routes;
25 |
26 | public class AfterResponse extends BaseEvent {
27 | private Routes.Route route;
28 | private String prefix;
29 |
30 | public AfterResponse(final HttpServletRequest request, final HttpServletResponse response) {
31 | super(request, response);
32 | }
33 |
34 | public String getPrefix() {
35 | return prefix;
36 | }
37 |
38 | public void setPrefix(final String prefix) {
39 | this.prefix = prefix;
40 | }
41 |
42 | public Routes.Route getRoute() {
43 | return route;
44 | }
45 |
46 | public void setRoute(final Routes.Route route) {
47 | this.route = route;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/BaseEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event;
20 |
21 | import jakarta.servlet.http.HttpServletRequest;
22 | import jakarta.servlet.http.HttpServletResponse;
23 |
24 | public class BaseEvent {
25 | private final HttpServletRequest request;
26 | private final HttpServletResponse response;
27 |
28 | protected BaseEvent(final HttpServletRequest request, final HttpServletResponse response) {
29 | this.request = request;
30 | this.response = response;
31 | }
32 |
33 | public HttpServletRequest getRequest() {
34 | return request;
35 | }
36 |
37 | public HttpServletResponse getResponse() {
38 | return response;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/BeforeRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event;
20 |
21 | import jakarta.servlet.http.HttpServletRequest;
22 | import jakarta.servlet.http.HttpServletResponse;
23 |
24 | import org.apache.meecrowave.proxy.servlet.configuration.Routes;
25 |
26 | public class BeforeRequest extends BaseEvent {
27 | private Routes.Route route;
28 | private String prefix;
29 |
30 | public BeforeRequest(final HttpServletRequest request, final HttpServletResponse response) {
31 | super(request, response);
32 | }
33 |
34 | public String getPrefix() {
35 | return prefix;
36 | }
37 |
38 | public void setPrefix(final String prefix) {
39 | this.prefix = prefix;
40 | }
41 |
42 | public Routes.Route getRoute() {
43 | return route;
44 | }
45 |
46 | public void setRoute(final Routes.Route route) {
47 | this.route = route;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/func/IOConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.proxy.servlet.front.cdi.func;
20 |
21 | import java.io.IOException;
22 |
23 | @FunctionalInterface
24 | public interface IOConsumer {
25 | void accept(T parameter) throws IOException;
26 | }
27 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/func/IOFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.meecrowave.proxy.servlet.front.cdi.func;
20 |
21 | import java.io.IOException;
22 |
23 | @FunctionalInterface
24 | public interface IOFunction {
25 | T apply(A a) throws IOException;
26 | }
27 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.proxy.servlet.front.cdi.extension.SpyExtension
2 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/main/resources/META-INF/services/org.apache.meecrowave.Meecrowave$ContextCustomizer:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.proxy.servlet.meecrowave.ProxyServletSetup
2 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/test/resources/ConfigurationLoaderTest/ensureDefaults.json:
--------------------------------------------------------------------------------
1 | {
2 | "routes": [
3 | {
4 | "id": "get-simple",
5 | "requestConfiguration": {
6 | "method": "GET",
7 | "prefix": "/simple"
8 | }
9 | }
10 | ]
11 | }
--------------------------------------------------------------------------------
/meecrowave-proxy/src/test/resources/ConfigurationLoaderTest/mergeWithDefaultRoute.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultRoute": {
3 | "responseConfiguration": {
4 | "target": "http://localhost:${fake.server.port}"
5 | },
6 | "clientConfiguration": {
7 | "timeouts": {
8 | "read": 1234,
9 | "connect": 1235
10 | },
11 | "executor": {
12 | "core": 1
13 | }
14 | }
15 | },
16 | "routes": [
17 | {
18 | "id": "get-simple",
19 | "requestConfiguration": {
20 | "method": "GET",
21 | "prefix": "/simple"
22 | },
23 | "clientConfiguration": {
24 | "timeouts": {
25 | "read": 6789
26 | }
27 | }
28 | }
29 | ]
30 | }
--------------------------------------------------------------------------------
/meecrowave-proxy/src/test/resources/ProxyServletTest/upload/file.txt:
--------------------------------------------------------------------------------
1 | test
2 | file
3 | with
4 | multiple
5 | lines
6 |
--------------------------------------------------------------------------------
/meecrowave-proxy/src/test/resources/routes.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultRoute": {
3 | "responseConfiguration": {
4 | // configure our global fake server for all the endpoints
5 | "target": "http://localhost:${fake.server.port}"
6 | }
7 | },
8 | "routes": [
9 | {
10 | // used to test a plain simple static endpoint - simplest case
11 | "id": "get-simple",
12 | "requestConfiguration": {
13 | "method": "GET",
14 | "prefix": "/simple"
15 | }
16 | },
17 | {
18 | /**
19 | * used to test a very trivial post without any query param or anything else
20 | */
21 | "id": "post-simple",
22 | "requestConfiguration": {
23 | "method": "POST",
24 | "prefix": "/data1"
25 | }
26 | },
27 | {
28 | "id": "multipart",
29 | "requestConfiguration": {
30 | "method": "POST",
31 | "prefix": "/upload1"
32 | }
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/meecrowave-websocket/src/main/resources/META-INF/services/jakarta.websocket.server.ServerEndpointConfig$Configurator:
--------------------------------------------------------------------------------
1 | org.apache.meecrowave.websocket.CDIServerConfigurator
--------------------------------------------------------------------------------
/test-app/src/main/java/org/superbiz/app/Injectable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.superbiz.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 |
23 | @ApplicationScoped
24 | public class Injectable {
25 | public String injected() {
26 | return "true";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/superbiz/app/OtherEndpoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.superbiz.app;
20 |
21 | import jakarta.enterprise.context.ApplicationScoped;
22 | import jakarta.inject.Inject;
23 | import jakarta.ws.rs.GET;
24 | import jakarta.ws.rs.Path;
25 | import jakarta.ws.rs.Produces;
26 |
27 | @Path("other")
28 | @ApplicationScoped
29 | public class OtherEndpoint
30 | {
31 | @Inject
32 | private Injectable injectable;
33 |
34 | @GET
35 | @Produces({"text/plain"})
36 | public String simple()
37 | {
38 | return Boolean.parseBoolean(this.injectable.injected()) ? "simple" : "fail";
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/superbiz/app/OtherFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.superbiz.app;
20 |
21 | import java.io.IOException;
22 | import java.io.PrintWriter;
23 | import jakarta.inject.Inject;
24 | import jakarta.servlet.Filter;
25 | import jakarta.servlet.FilterChain;
26 | import jakarta.servlet.FilterConfig;
27 | import jakarta.servlet.ServletException;
28 | import jakarta.servlet.ServletRequest;
29 | import jakarta.servlet.ServletResponse;
30 | import jakarta.servlet.annotation.WebFilter;
31 |
32 | @WebFilter({"/other"})
33 | public class OtherFilter
34 | implements Filter
35 | {
36 | @Inject
37 | private Injectable injectable;
38 |
39 | public void init(FilterConfig filterConfig)
40 | throws ServletException
41 | {}
42 |
43 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
44 | throws IOException, ServletException
45 | {
46 | response.getWriter().write("filter" + this.injectable.injected());
47 | }
48 |
49 | public void destroy() {}
50 | }
51 |
--------------------------------------------------------------------------------