├── .gitignore
├── LICENSE.txt
├── README.md
├── ToDo.md
├── _data
├── logo_intellij_idea.png
└── yklogo.png
├── deploy.sh
├── docker-compose.yml
├── docker_compile_locale.sh
├── impl
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── rapidpm
│ │ └── proxybuilder
│ │ ├── BasicAnnotationProcessor.java
│ │ ├── RapidPMMetricsRegistry.java
│ │ ├── objectadapter
│ │ ├── BasicObjectAdapterAnnotationProcessor.java
│ │ ├── DynamicObjectAdapterAnnotationProcessor.java
│ │ ├── IsObjectAdapter.java
│ │ ├── StaticObjectAdapterAnnotationProcessor.java
│ │ ├── dynamic
│ │ │ ├── AdapterBuilder.java
│ │ │ ├── DynamicObjectAdapterBuilder.java
│ │ │ ├── ExtendedInvocationHandler.java
│ │ │ ├── IsDynamicObjectAdapter.java
│ │ │ └── MethodIdentifier.java
│ │ └── generated
│ │ │ ├── IsStaticObjectAdapter.java
│ │ │ └── StaticObjectAdapter.java
│ │ └── proxy
│ │ ├── dymamic
│ │ ├── DynamicProxyBuilder.java
│ │ ├── PostAction.java
│ │ ├── PreAction.java
│ │ ├── SecurityRule.java
│ │ └── virtual
│ │ │ ├── DynamicProxyGenerator.java
│ │ │ ├── VirtualDynamicProxyInvocationHandler.java
│ │ │ ├── factory
│ │ │ ├── DefaultConstructorServiceFactory.java
│ │ │ └── ServiceFactory.java
│ │ │ └── strategy
│ │ │ ├── CreationStrategy.java
│ │ │ ├── ServiceStrategyFactory.java
│ │ │ ├── ServiceStrategyFactoryMethodScoped.java
│ │ │ ├── ServiceStrategyFactoryNoDuplicates.java
│ │ │ ├── ServiceStrategyFactoryNotThreadSafe.java
│ │ │ ├── ServiceStrategyFactorySomeDuplicates.java
│ │ │ └── ServiceStrategyFactorySynchronized.java
│ │ └── generated
│ │ ├── BasicStaticProxyAnnotationProcessor.java
│ │ ├── StaticLoggingProxyAnnotationProcessor.java
│ │ ├── StaticMetricsProxyAnnotationProcessor.java
│ │ ├── StaticVirtualProxyAnnotationProcessor.java
│ │ └── annotations
│ │ ├── IsGeneratedProxy.java
│ │ ├── IsLoggingProxy.java
│ │ ├── IsMetricsProxy.java
│ │ ├── IsVirtualProxy.java
│ │ ├── StaticLoggingProxy.java
│ │ ├── StaticMetricsProxy.java
│ │ └── StaticVirtualProxy.java
│ └── resources
│ └── META-INF
│ └── services
│ └── javax.annotation.processing.Processor
├── pom.xml
└── testusage
├── pom.xml
└── src
├── main
├── java
│ └── org
│ │ └── rapidpm
│ │ └── proxybuilder
│ │ ├── InnerDemoClass.java
│ │ ├── InnerDemoInterface.java
│ │ ├── objectadapter
│ │ └── testusage
│ │ │ ├── v001
│ │ │ ├── Service.java
│ │ │ └── ServiceImpl.java
│ │ │ ├── v002
│ │ │ ├── LevelA.java
│ │ │ └── LevelB.java
│ │ │ ├── v003
│ │ │ ├── Main.java
│ │ │ └── MyConnection.java
│ │ │ └── v004
│ │ │ └── Service.java
│ │ └── proxy
│ │ └── generated
│ │ ├── ServiceImpl.java
│ │ ├── metrics
│ │ └── v001
│ │ │ └── DemoInterfaceA.java
│ │ ├── pkg01
│ │ └── ServiceImpl.java
│ │ ├── pkg02
│ │ └── ServiceImpl.java
│ │ ├── v001
│ │ ├── BaseInterface.java
│ │ ├── Level1Interface.java
│ │ ├── Level2Interface.java
│ │ └── Level3Interface.java
│ │ ├── v002
│ │ ├── BaseInterface.java
│ │ ├── Level1Interface.java
│ │ ├── Level2_A_Interface.java
│ │ └── Level2_B_Interface.java
│ │ ├── v003
│ │ ├── BaseInterface.java
│ │ ├── Level1Interface.java
│ │ ├── Level2Impl.java
│ │ └── Level3Impl.java
│ │ ├── v004
│ │ ├── BaseInterface.java
│ │ ├── Level1Interface.java
│ │ ├── Level2Impl.java
│ │ └── Level3Impl.java
│ │ ├── v005
│ │ └── BaseInterface.java
│ │ ├── v006
│ │ └── BaseImpl.java
│ │ ├── v007
│ │ └── MyConnection.java
│ │ ├── v008
│ │ ├── LoggerExample.java
│ │ └── MyLoggingInterface.java
│ │ ├── v009
│ │ ├── MyChildClass.java
│ │ └── MyClass.java
│ │ ├── v010
│ │ └── MyClass.java
│ │ ├── v011
│ │ ├── FooImpl.java
│ │ ├── FooLeft.java
│ │ ├── FooRight.java
│ │ └── FooTop.java
│ │ └── v012
│ │ ├── MyBaseClass.java
│ │ ├── MyBaseInterface.java
│ │ ├── MyClass.java
│ │ └── MyExtendedClass.java
└── kotlin
│ └── org
│ └── rapidpm
│ └── proxybuilder
│ └── proxy
│ └── generated
│ ├── v005
│ └── KotlinImpl.kt
│ └── v008
│ └── kotlin
│ └── MyLoggingInterface.kt
└── test
└── java
├── demo
└── reflections
│ ├── Inject.java
│ ├── ReflectionsDemo.java
│ └── model
│ └── model_a
│ └── Model_A.java
└── junit
└── org
└── rapidpm
└── proxybuilder
├── model
├── DemoClassA.java
├── DemoClassB.java
├── DemoClassC.java
├── DemoInterface.java
├── DemoLogic.java
└── FinalDemoLogic.java
├── proxy
├── dynamic
│ ├── AddPreActionTest.java
│ ├── DynamicLoggingProxyTest.java
│ ├── DynamicProxyBuilderTest.java
│ ├── DynamicProxyGeneratorVirtualTest.java
│ ├── InnerDemoClass.java
│ ├── InnerDemoInterface.java
│ └── virtual
│ │ ├── DynamicVirtualproxyTest001.java
│ │ └── methodscoped
│ │ └── v001
│ │ └── MethodScopedTest.java
└── generated
│ └── v008
│ └── MyLoggingInterfaceTest.java
└── reflection
├── ClassPathScanner.java
├── PackageClassLoader.java
├── PackageClassLoaderTest.java
└── test001
├── KlasseA.java
├── KlasseB.java
└── a
├── KlasseA.java
└── KlasseB.java
/.gitignore:
--------------------------------------------------------------------------------
1 | _data/_apidoc
2 |
3 |
4 | # Created by .ignore support plugin (hsz.mobi)
5 | ### Eclipse template
6 | *.pydevproject
7 | .metadata
8 | .gradle
9 | bin/
10 | tmp/
11 | *.tmp
12 | *.bak
13 | *.swp
14 | *~.nib
15 |
16 | local.properties
17 | .settings/
18 | .loadpath
19 |
20 | # Eclipse Core
21 | .project
22 |
23 | # External tool builders
24 | .externalToolBuilders/
25 |
26 | # Locally stored "Eclipse launch configurations"
27 | *.launch
28 |
29 | # CDT-specific
30 | .cproject
31 |
32 | # JDT-specific (Eclipse Java Development Tools)
33 | .classpath
34 |
35 | # PDT-specific
36 | .buildpath
37 |
38 | # sbteclipse plugin
39 | .target
40 |
41 | # TeXlipse plugin
42 | .texlipse
43 |
44 |
45 | ### JetBrains template
46 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
47 | .idea/
48 | *.iml
49 |
50 | ## Directory-based project format:
51 | # .idea/
52 | # if you remove the above rule, at least ignore the following:
53 |
54 | # User-specific stuff:
55 | .idea/workspace.xml
56 | .idea/tasks.xml
57 | .idea/dictionaries
58 |
59 | # Sensitive or high-churn files:
60 | .idea/dataSources.ids
61 | .idea/dataSources.xml
62 | .idea/sqlDataSources.xml
63 | .idea/dynamic.xml
64 | .idea/uiDesigner.xml
65 |
66 | # Gradle:
67 | .idea/gradle.xml
68 | .idea/libraries
69 |
70 | # Mongo Explorer plugin:
71 | .idea/mongoSettings.xml
72 |
73 | ## File-based project format:
74 | *.ipr
75 | *.iws
76 |
77 | ## Plugin-specific files:
78 |
79 | # IntelliJ
80 | /out/
81 |
82 | # mpeltonen/sbt-idea plugin
83 | .idea_modules/
84 |
85 | # JIRA plugin
86 | atlassian-ide-plugin.xml
87 |
88 | # Crashlytics plugin (for Android Studio and IntelliJ)
89 | com_crashlytics_export_strings.xml
90 | crashlytics.properties
91 | crashlytics-build.properties
92 |
93 |
94 | ### Maven template
95 | target/
96 | pom.xml.tag
97 | pom.xml.releaseBackup
98 | pom.xml.versionsBackup
99 | pom.xml.next
100 | release.properties
101 | dependency-reduced-pom.xml
102 | buildNumber.properties
103 | .mvn/timing.properties
104 |
105 |
106 | ### JDeveloper template
107 | # default application storage directory used by the IDE Performance Cache feature
108 | .data/
109 |
110 | # used for ADF styles caching
111 | temp/
112 |
113 | # default output directories
114 | classes/
115 | deploy/
116 | javadoc/
117 |
118 | # lock file, a part of Oracle Credential Store Framework
119 | cwallet.sso.lck
120 |
121 | ### Java template
122 | *.class
123 |
124 | # Mobile Tools for Java (J2ME)
125 | .mtj.tmp/
126 |
127 | # Package Files #
128 | *.jar
129 | *.war
130 | *.ear
131 |
132 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
133 | hs_err_pid*
134 |
135 |
136 |
--------------------------------------------------------------------------------
/ToDo.md:
--------------------------------------------------------------------------------
1 | # ToDos
2 |
3 | * remove the metrics proxies to an external module (proxybuilder add ons)
4 |
5 |
--------------------------------------------------------------------------------
/_data/logo_intellij_idea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svenruppert/proxybuilder/c96c05a68c2b24abe92ade8e708629538670743d/_data/logo_intellij_idea.png
--------------------------------------------------------------------------------
/_data/yklogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svenruppert/proxybuilder/c96c05a68c2b24abe92ade8e708629538670743d/_data/yklogo.png
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # 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 |
18 | docker rm deploy
19 | docker-compose up
20 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | version: '3.5'
18 |
19 | services:
20 | deploy:
21 | image: svenruppert/maven-3.6.1-adopt:1.8.212-04
22 | container_name: deploy
23 | hostname: deploy
24 | volumes:
25 | - /var/run/docker.sock:/tmp/docker.sock:ro
26 | - $PWD/:/usr/src/mymaven
27 | - ~/.m2/settings.xml:/root/.m2/settings.xml
28 | - ~/.gnupg/:/root/.gnupg/
29 | working_dir: /usr/src/mymaven
30 | # command: 'mvn help:active-profiles
31 | command: 'mvn license:format clean deploy
32 | -P_release
33 | -Dmaven.test.skip=true '
--------------------------------------------------------------------------------
/docker_compile_locale.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # 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 |
18 |
19 | docker run \
20 | --rm \
21 | --name compile \
22 | -v "$(pwd)":/usr/src/mymaven \
23 | -w /usr/src/mymaven \
24 | svenruppert/maven-3.6.1-adopt:1.8.212-04 \
25 | mvn clean install
26 |
--------------------------------------------------------------------------------
/impl/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
22 |
23 | org.rapidpm.proxybuilder
24 | rapidpm-proxybuilder
25 | 00.09.06-RPM-SNAPSHOT
26 |
27 | 4.0.0
28 |
29 | rapidpm-proxybuilder-impl
30 |
31 |
32 |
33 |
34 | net.oneandone.reflections8
35 | reflections8
36 | 0.11.4
37 |
38 |
39 |
40 |
41 |
42 |
43 | maven-compiler-plugin
44 |
45 | -Xlint:all
46 | -proc:none
47 | true
48 | true
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/RapidPMMetricsRegistry.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder;
32 |
33 | import com.codahale.metrics.ConsoleReporter;
34 | import com.codahale.metrics.MetricRegistry;
35 | import com.codahale.metrics.jmx.JmxReporter;
36 |
37 | import java.util.concurrent.TimeUnit;
38 |
39 | public class RapidPMMetricsRegistry {
40 |
41 |
42 | public static final TimeUnit DURATION_UNIT = TimeUnit.MILLISECONDS;
43 | public static final TimeUnit RATE_UNIT = TimeUnit.MILLISECONDS;
44 | private static final Object LOCK = new Object();
45 | private static final RapidPMMetricsRegistry RAPID_PM_METRICS_REGISTRY = new RapidPMMetricsRegistry();
46 | private final MetricRegistry metrics = new MetricRegistry();
47 |
48 | private JmxReporter jmxReporter;
49 | private ConsoleReporter consoleReporter;
50 |
51 | private RapidPMMetricsRegistry() {
52 | }
53 |
54 | public static RapidPMMetricsRegistry getInstance() {
55 | return RAPID_PM_METRICS_REGISTRY;
56 | }
57 |
58 | public MetricRegistry getMetrics() {
59 | return metrics;
60 | }
61 |
62 | public void startJmxReporter() {
63 |
64 | synchronized (LOCK) {
65 | if (jmxReporter == null) {
66 | jmxReporter = JmxReporter.forRegistry(metrics)
67 | .convertDurationsTo(DURATION_UNIT)
68 | .convertRatesTo(RATE_UNIT)
69 | .build();
70 | }
71 | jmxReporter.start();
72 | }
73 |
74 | }
75 |
76 | public void stopJmxReporter() {
77 | synchronized (LOCK) {
78 | if (jmxReporter != null) {
79 | jmxReporter.stop();
80 | jmxReporter.close();
81 | jmxReporter = null;
82 | }
83 | }
84 | }
85 |
86 | public void startConsoleReporter() {
87 | synchronized (LOCK) {
88 | if (consoleReporter == null) {
89 | consoleReporter = ConsoleReporter.forRegistry(metrics)
90 | .convertDurationsTo(DURATION_UNIT)
91 | .convertRatesTo(RATE_UNIT)
92 | .build();
93 | consoleReporter.start(5, TimeUnit.SECONDS);
94 | }
95 | }
96 | }
97 |
98 | public void stopConsoleReporter() {
99 | synchronized (LOCK) {
100 | if (consoleReporter != null) {
101 | consoleReporter.stop();
102 | consoleReporter.close();
103 | consoleReporter = null;
104 | }
105 | }
106 | }
107 |
108 | }
109 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/BasicObjectAdapterAnnotationProcessor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter;
32 |
33 |
34 | import org.rapidpm.proxybuilder.BasicAnnotationProcessor;
35 |
36 | import java.lang.annotation.Annotation;
37 |
38 | public abstract class BasicObjectAdapterAnnotationProcessor extends BasicAnnotationProcessor {
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/IsObjectAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface IsObjectAdapter {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/dynamic/AdapterBuilder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.dynamic;
32 |
33 | import java.lang.reflect.Proxy;
34 |
35 | public abstract class AdapterBuilder {
36 |
37 | public T buildForTarget(Class target) {
38 | return (T) Proxy.newProxyInstance(
39 | target.getClassLoader(),
40 | new Class[]{target},
41 | getInvocationHandler()
42 | );
43 | }
44 |
45 | protected abstract > I getInvocationHandler();
46 | }
47 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/dynamic/DynamicObjectAdapterBuilder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.dynamic;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.SOURCE)
39 | @Target(ElementType.TYPE)
40 | public @interface DynamicObjectAdapterBuilder {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/dynamic/ExtendedInvocationHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.dynamic;
32 |
33 |
34 | import java.lang.reflect.InvocationHandler;
35 | import java.lang.reflect.InvocationTargetException;
36 | import java.lang.reflect.Method;
37 | import java.util.HashMap;
38 | import java.util.Map;
39 |
40 | public abstract class ExtendedInvocationHandler implements InvocationHandler {
41 |
42 | private final Map adaptedMethods = new HashMap<>();
43 | private final Map adapters = new HashMap<>();
44 | private T original;
45 |
46 | public void setOriginal(T original) {
47 | this.original = original;
48 | }
49 |
50 | public void addAdapter(Object adapter) {
51 | final Class> adapterClass = adapter.getClass();
52 | Method[] methods = adapterClass.getDeclaredMethods();
53 | for (Method m : methods) {
54 | final MethodIdentifier key = new MethodIdentifier(m);
55 | adaptedMethods.put(key, m);
56 | adapters.put(key, adapter);
57 | }
58 | }
59 |
60 | @Override
61 | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
62 | try {
63 | final MethodIdentifier key = new MethodIdentifier(method);
64 | Method other = adaptedMethods.get(key);
65 | if (other != null) {
66 | other.setAccessible(true); //Lambdas...
67 | final Object result = other.invoke(adapters.get(key), args);
68 | other.setAccessible(false);
69 | return result;
70 | } else {
71 | return method.invoke(original, args);
72 | }
73 | } catch (InvocationTargetException e) {
74 | throw e.getTargetException();
75 | }
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/dynamic/IsDynamicObjectAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.dynamic;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.SOURCE)
39 | @Target(ElementType.TYPE)
40 | public @interface IsDynamicObjectAdapter {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/dynamic/MethodIdentifier.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.dynamic;
32 |
33 | import java.lang.reflect.Method;
34 | import java.util.Arrays;
35 |
36 | /**
37 | * Created by RapidPM - Team
38 | */
39 | public class MethodIdentifier {
40 | private final String name;
41 | private final Class[] parameters;
42 |
43 | public MethodIdentifier(Method m) {
44 | name = m.getName();
45 | parameters = m.getParameterTypes();
46 | }
47 |
48 | public int hashCode() {
49 | return name.hashCode();
50 | }
51 |
52 | // we can save time by assuming that we only compare against
53 | // other MethodIdentifier objects
54 | public boolean equals(Object o) {
55 | MethodIdentifier mid = (MethodIdentifier) o;
56 | return name.equals(mid.name) &&
57 | Arrays.equals(parameters, mid.parameters);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/generated/IsStaticObjectAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.generated;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface IsStaticObjectAdapter {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/objectadapter/generated/StaticObjectAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.generated;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface StaticObjectAdapter {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/PostAction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.dymamic;
17 |
18 | import java.lang.reflect.Method;
19 |
20 | public interface PostAction {
21 | void execute(T original, Method method, Object[] args) throws Throwable;
22 | }
23 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/PreAction.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.dymamic;
17 |
18 | import java.lang.reflect.Method;
19 |
20 | public interface PreAction {
21 | void execute(T original, Method method, Object[] args) throws Throwable;
22 | }
23 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/SecurityRule.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic;
32 |
33 | public interface SecurityRule {
34 | boolean checkRule();
35 | }
36 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/VirtualDynamicProxyInvocationHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.ServiceStrategyFactory;
36 |
37 | import java.lang.reflect.InvocationHandler;
38 | import java.lang.reflect.InvocationTargetException;
39 | import java.lang.reflect.Method;
40 |
41 | public class VirtualDynamicProxyInvocationHandler implements InvocationHandler {
42 |
43 | private ServiceFactory serviceFactory;
44 | private ServiceStrategyFactory serviceStrategyFactory;
45 |
46 | public static Builder newBuilder() {
47 | return new Builder<>();
48 | }
49 |
50 | private VirtualDynamicProxyInvocationHandler(final Builder builder) {
51 | serviceFactory = builder.serviceFactory;
52 | serviceStrategyFactory = builder.serviceStrategyFactory;
53 | }
54 |
55 | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
56 | final C obj = serviceStrategyFactory.realSubject(serviceFactory);
57 | try {
58 | return method.invoke(obj, args);
59 | } catch (InvocationTargetException ex) {
60 | throw ex.getCause();
61 | }
62 | // invoke(obj, method, args);
63 | }
64 |
65 | public static final class Builder {
66 | private ServiceFactory serviceFactory;
67 | private ServiceStrategyFactory serviceStrategyFactory;
68 |
69 | private Builder() {
70 | }
71 |
72 | public Builder withServiceFactory(final ServiceFactory serviceFactory) {
73 | this.serviceFactory = serviceFactory;
74 | return this;
75 | }
76 |
77 | public Builder withServiceStrategyFactory(final ServiceStrategyFactory serviceStrategyFactory) {
78 | this.serviceStrategyFactory = serviceStrategyFactory;
79 | return this;
80 | }
81 |
82 | public VirtualDynamicProxyInvocationHandler build() {
83 | return new VirtualDynamicProxyInvocationHandler<>(this);
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/factory/DefaultConstructorServiceFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory;
32 |
33 |
34 | public class DefaultConstructorServiceFactory implements ServiceFactory {
35 |
36 |
37 | private final Class realClass;
38 |
39 | public DefaultConstructorServiceFactory(final Class realClass) {
40 | this.realClass = realClass;
41 | }
42 |
43 | @Override
44 | public C createInstance() {
45 | C newInstance = null;
46 | try {
47 | newInstance = realClass.newInstance();
48 | } catch (InstantiationException | IllegalAccessException e) {
49 | e.printStackTrace();
50 | }
51 | return newInstance;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/factory/ServiceFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory;
17 |
18 | public interface ServiceFactory {
19 | C createInstance();
20 | }
21 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/CreationStrategy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 | public enum CreationStrategy {
34 | NONE,
35 | SOME_DUPLICATES,
36 | NO_DUPLICATES,
37 | SYNCHRONIZED,
38 | METHOD_SCOPED
39 | }
40 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
17 |
18 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
19 |
20 | /**
21 | * Strategy of creating: ThreadSave, NotThreadSave, ...
22 | */
23 | public interface ServiceStrategyFactory {
24 | C realSubject(ServiceFactory factory);
25 | }
26 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactoryMethodScoped.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 |
36 | public class ServiceStrategyFactoryMethodScoped implements ServiceStrategyFactory {
37 |
38 | @Override
39 | public synchronized T realSubject(ServiceFactory factory) {
40 | return factory.createInstance();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactoryNoDuplicates.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 |
36 | import java.util.concurrent.locks.Lock;
37 | import java.util.concurrent.locks.ReentrantLock;
38 |
39 | public class ServiceStrategyFactoryNoDuplicates implements ServiceStrategyFactory {
40 |
41 | private final Lock initializationLock = new ReentrantLock();
42 | private volatile T realSubject;
43 |
44 | @Override
45 | public T realSubject(ServiceFactory factory) {
46 | T result = realSubject;
47 | if (result == null) {
48 | initializationLock.lock();
49 | try {
50 | result = realSubject;
51 | if (result == null) {
52 | result = realSubject = factory.createInstance();
53 | }
54 | } finally {
55 | initializationLock.unlock();
56 | }
57 | }
58 | return result;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactoryNotThreadSafe.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 |
36 | public class ServiceStrategyFactoryNotThreadSafe
37 | implements ServiceStrategyFactory {
38 |
39 | private T service; //nix lambda
40 |
41 | @Override
42 | public T realSubject(ServiceFactory factory) {
43 | if (service == null) {
44 | service = factory.createInstance();
45 | }
46 | return service;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactorySomeDuplicates.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 |
36 | import java.util.concurrent.atomic.AtomicReference;
37 |
38 | public class ServiceStrategyFactorySomeDuplicates implements ServiceStrategyFactory {
39 | private final AtomicReference ref = new AtomicReference<>();
40 |
41 | @Override
42 | public T realSubject(ServiceFactory factory) {
43 |
44 | T service = ref.get();
45 | if (service == null) {
46 | service = factory.createInstance();
47 | if (!ref.compareAndSet(null, service)) {
48 | service = ref.get();
49 | }
50 | }
51 | return service;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/dymamic/virtual/strategy/ServiceStrategyFactorySynchronized.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy;
32 |
33 |
34 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
35 |
36 | public class ServiceStrategyFactorySynchronized implements ServiceStrategyFactory {
37 |
38 | private T service; //nix lambda
39 |
40 | @Override
41 | public synchronized T realSubject(ServiceFactory factory) {
42 | if (service == null) {
43 | service = factory.createInstance();
44 | }
45 | return service;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/BasicStaticProxyAnnotationProcessor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated;
32 |
33 |
34 | import org.rapidpm.proxybuilder.BasicAnnotationProcessor;
35 |
36 | import java.lang.annotation.Annotation;
37 |
38 | public abstract class BasicStaticProxyAnnotationProcessor extends BasicAnnotationProcessor {
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/IsGeneratedProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface IsGeneratedProxy {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/IsLoggingProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | /**
39 | * Copyright (C) 2010 RapidPM
40 | * Licensed under the Apache License, Version 2.0 (the "License");
41 | * you may not use this file except in compliance with the License.
42 | * You may obtain a copy of the License at
43 | * http://www.apache.org/licenses/LICENSE-2.0
44 | * Unless required by applicable law or agreed to in writing, software
45 | * distributed under the License is distributed on an "AS IS" BASIS,
46 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | * See the License for the specific language governing permissions and
48 | * limitations under the License.
49 | *
50 | * Created by RapidPM - Team on 09.05.16.
51 | */
52 | @Retention(RetentionPolicy.RUNTIME)
53 | @Target(ElementType.TYPE)
54 | public @interface IsLoggingProxy {
55 | }
56 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/IsMetricsProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface IsMetricsProxy {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/IsVirtualProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface IsVirtualProxy {
41 | }
42 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/StaticLoggingProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | /**
39 | * Copyright (C) 2010 RapidPM
40 | * Licensed under the Apache License, Version 2.0 (the "License");
41 | * you may not use this file except in compliance with the License.
42 | * You may obtain a copy of the License at
43 | * http://www.apache.org/licenses/LICENSE-2.0
44 | * Unless required by applicable law or agreed to in writing, software
45 | * distributed under the License is distributed on an "AS IS" BASIS,
46 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | * See the License for the specific language governing permissions and
48 | * limitations under the License.
49 | *
50 | * Created by RapidPM - Team on 09.05.16.
51 | */
52 | @Retention(RetentionPolicy.RUNTIME)
53 | @Target(ElementType.TYPE)
54 | public @interface StaticLoggingProxy {
55 | }
56 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/StaticMetricsProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 | @Retention(RetentionPolicy.RUNTIME)
39 | @Target(ElementType.TYPE)
40 | public @interface StaticMetricsProxy {
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/impl/src/main/java/org/rapidpm/proxybuilder/proxy/generated/annotations/StaticVirtualProxy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.annotations;
32 |
33 | import java.lang.annotation.ElementType;
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 | import java.lang.annotation.Target;
37 |
38 |
39 | @Retention(RetentionPolicy.RUNTIME)
40 | @Target(ElementType.TYPE)
41 | public @interface StaticVirtualProxy {
42 | // CreationStrategy strategy() default CreationStrategy.NONE;
43 | }
44 |
--------------------------------------------------------------------------------
/impl/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | org.rapidpm.proxybuilder.objectadapter.StaticObjectAdapterAnnotationProcessor
2 | org.rapidpm.proxybuilder.objectadapter.DynamicObjectAdapterAnnotationProcessor
3 | org.rapidpm.proxybuilder.proxy.generated.StaticMetricsProxyAnnotationProcessor
4 | org.rapidpm.proxybuilder.proxy.generated.StaticLoggingProxyAnnotationProcessor
5 | org.rapidpm.proxybuilder.proxy.generated.StaticVirtualProxyAnnotationProcessor
6 |
7 |
--------------------------------------------------------------------------------
/testusage/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
22 |
23 | rapidpm-proxybuilder
24 | org.rapidpm.proxybuilder
25 | 00.09.06-RPM-SNAPSHOT
26 |
27 | 4.0.0
28 |
29 | rapidpm-proxybuilder-testusage
30 |
31 |
32 |
33 | org.rapidpm.proxybuilder
34 | rapidpm-proxybuilder-impl
35 |
36 |
37 |
38 |
39 |
40 |
41 | maven-checkstyle-plugin
42 |
43 | true
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/InnerDemoClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder;
32 |
33 | public class InnerDemoClass implements InnerDemoInterface {
34 |
35 | public InnerDemoClass() {
36 | System.out.println("InnerDemoClass = init");
37 | }
38 |
39 | @Override
40 | public String doWork() {
41 | return "InnerDemoClass.doWork()";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/InnerDemoInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder;
32 |
33 | public interface InnerDemoInterface {
34 | String doWork();
35 | }
36 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v001/Service.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v001;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.dynamic.DynamicObjectAdapterBuilder;
34 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
35 |
36 | @StaticObjectAdapter
37 | @DynamicObjectAdapterBuilder
38 | public interface Service {
39 | String doWork(String txt);
40 |
41 | String doMoreWorkA(String txt);
42 |
43 | String doMoreWorkB(String txt);
44 |
45 | String doMoreWorkC(String txt);
46 |
47 | String doMoreWorkD(String txt);
48 | }
49 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v001/ServiceImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v001;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
34 |
35 | @StaticObjectAdapter
36 | public class ServiceImpl implements Service {
37 | @Override
38 | public String doWork(final String txt) {
39 | return txt + " - ServiceImpl";
40 | }
41 |
42 | @Override
43 | public String doMoreWorkA(final String txt) {
44 | return txt + " - ServiceImpl.doMoreWorkA";
45 | }
46 |
47 | @Override
48 | public String doMoreWorkB(final String txt) {
49 | return txt + " - ServiceImpl.doMoreWorkB";
50 | }
51 |
52 | @Override
53 | public String doMoreWorkC(final String txt) {
54 | return txt + " - ServiceImpl.doMoreWorkC";
55 | }
56 |
57 | @Override
58 | public String doMoreWorkD(final String txt) {
59 | return txt + " - ServiceImpl.doMoreWorkD";
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v002/LevelA.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v002;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.dynamic.DynamicObjectAdapterBuilder;
34 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
35 |
36 | /**
37 | * Copyright (C) 2010 RapidPM
38 | * Licensed under the Apache License, Version 2.0 (the "License");
39 | * you may not use this file except in compliance with the License.
40 | * You may obtain a copy of the License at
41 | * http://www.apache.org/licenses/LICENSE-2.0
42 | * Unless required by applicable law or agreed to in writing, software
43 | * distributed under the License is distributed on an "AS IS" BASIS,
44 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45 | * See the License for the specific language governing permissions and
46 | * limitations under the License.
47 | *
48 | * Created by RapidPM - Team on 19.05.16.
49 | */
50 | @DynamicObjectAdapterBuilder
51 | @StaticObjectAdapter
52 | public interface LevelA {
53 | String dowWorkA();
54 | }
55 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v002/LevelB.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v002;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.dynamic.DynamicObjectAdapterBuilder;
34 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
35 |
36 |
37 | /**
38 | * Copyright (C) 2010 RapidPM
39 | * Licensed under the Apache License, Version 2.0 (the "License");
40 | * you may not use this file except in compliance with the License.
41 | * You may obtain a copy of the License at
42 | * http://www.apache.org/licenses/LICENSE-2.0
43 | * Unless required by applicable law or agreed to in writing, software
44 | * distributed under the License is distributed on an "AS IS" BASIS,
45 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46 | * See the License for the specific language governing permissions and
47 | * limitations under the License.
48 | *
49 | * Created by RapidPM - Team on 19.05.16.
50 | */
51 |
52 | @DynamicObjectAdapterBuilder
53 | @StaticObjectAdapter
54 | public interface LevelB extends LevelA {
55 | String doWorkB();
56 | }
57 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v003/Main.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v003;
32 |
33 | import java.sql.SQLException;
34 | import java.sql.Savepoint;
35 |
36 | /**
37 | * Copyright (C) 2010 RapidPM
38 | * Licensed under the Apache License, Version 2.0 (the "License");
39 | * you may not use this file except in compliance with the License.
40 | * You may obtain a copy of the License at
41 | * http://www.apache.org/licenses/LICENSE-2.0
42 | * Unless required by applicable law or agreed to in writing, software
43 | * distributed under the License is distributed on an "AS IS" BASIS,
44 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45 | * See the License for the specific language governing permissions and
46 | * limitations under the License.
47 | *
48 | * Created by RapidPM - Team on 25.05.16.
49 | */
50 | public class Main {
51 |
52 | public static void main(String[] args) {
53 | // final MyConnection myConnection = MyConnectionAdapterBuilder.newBuilder()
54 | // .setOriginal(null)
55 | // .withSetSavepoint(() -> {
56 | // System.out.println("void");
57 | // return null;
58 | // })
59 | // .withSetSavepoint(arg0 -> {
60 | // System.out.println("arg0 = " + arg0);
61 | // return null;
62 | // })
63 | // .withSetSavepoint(new MyConnectionMethodSetSavepoint_1958648106() {
64 | // @Override
65 | // public Savepoint setSavepoint() throws SQLException {
66 | // System.out.println("void");
67 | // return null;
68 | // }
69 | // })
70 | // .withSetSavepoint(new MyConnectionMethodSetSavepoint_429780504() {
71 | // @Override
72 | // public Savepoint setSavepoint(final String arg0) throws SQLException {
73 | // System.out.println("arg0 = " + arg0);
74 | // return null;
75 | // }
76 | // })
77 | // .buildForTarget(MyConnection.class);
78 |
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v003/MyConnection.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v003;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.dynamic.DynamicObjectAdapterBuilder;
34 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
35 |
36 | import java.sql.Connection;
37 |
38 | /**
39 | * Copyright (C) 2010 RapidPM
40 | * Licensed under the Apache License, Version 2.0 (the "License");
41 | * you may not use this file except in compliance with the License.
42 | * You may obtain a copy of the License at
43 | * http://www.apache.org/licenses/LICENSE-2.0
44 | * Unless required by applicable law or agreed to in writing, software
45 | * distributed under the License is distributed on an "AS IS" BASIS,
46 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | * See the License for the specific language governing permissions and
48 | * limitations under the License.
49 | *
50 | * Created by RapidPM - Team on 20.05.16.
51 | */
52 |
53 | @DynamicObjectAdapterBuilder
54 | @StaticObjectAdapter
55 | public interface MyConnection extends Connection {
56 | String doWorkA();
57 | }
58 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/objectadapter/testusage/v004/Service.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.objectadapter.testusage.v004;
32 |
33 | import org.rapidpm.proxybuilder.objectadapter.dynamic.DynamicObjectAdapterBuilder;
34 | import org.rapidpm.proxybuilder.objectadapter.generated.StaticObjectAdapter;
35 |
36 | /**
37 | * Copyright (C) 2010 RapidPM
38 | * Licensed under the Apache License, Version 2.0 (the "License");
39 | * you may not use this file except in compliance with the License.
40 | * You may obtain a copy of the License at
41 | * http://www.apache.org/licenses/LICENSE-2.0
42 | * Unless required by applicable law or agreed to in writing, software
43 | * distributed under the License is distributed on an "AS IS" BASIS,
44 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45 | * See the License for the specific language governing permissions and
46 | * limitations under the License.
47 | *
48 | * Created by RapidPM - Team on 20.05.16.
49 | */
50 |
51 | @DynamicObjectAdapterBuilder
52 | @StaticObjectAdapter
53 | public interface Service {
54 |
55 | void doWork();
56 | String doWorkReturnValue();
57 | }
58 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/ServiceImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | import java.time.LocalDateTime;
36 | import java.util.Collections;
37 | import java.util.List;
38 |
39 | @StaticMetricsProxy
40 | public class ServiceImpl {
41 |
42 | public String doWork(String txt) {
43 | return txt + LocalDateTime.now();
44 | }
45 |
46 |
47 | public void doNothing() {
48 | }
49 |
50 | public List createList() throws NegativeArraySizeException {
51 | return Collections.emptyList();
52 | }
53 |
54 | public List createListA() throws Exception {
55 | return Collections.emptyList();
56 | }
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/metrics/v001/DemoInterfaceA.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.metrics.v001;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
35 |
36 | /**
37 | * Copyright (C) 2010 RapidPM
38 | * Licensed under the Apache License, Version 2.0 (the "License");
39 | * you may not use this file except in compliance with the License.
40 | * You may obtain a copy of the License at
41 | * http://www.apache.org/licenses/LICENSE-2.0
42 | * Unless required by applicable law or agreed to in writing, software
43 | * distributed under the License is distributed on an "AS IS" BASIS,
44 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45 | * See the License for the specific language governing permissions and
46 | * limitations under the License.
47 | *
48 | * Created by RapidPM - Team on 11.05.16.
49 | */
50 | @StaticMetricsProxy
51 | @StaticLoggingProxy
52 | public class DemoInterfaceA {
53 | public static String doStaticWork(String txt){
54 | return "XX"+txt;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/pkg01/ServiceImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.pkg01;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | import java.time.LocalDateTime;
36 | import java.util.Collections;
37 | import java.util.List;
38 |
39 | @StaticMetricsProxy
40 | public class ServiceImpl {
41 |
42 | public String doWork(String txt) {
43 | return txt + LocalDateTime.now();
44 | }
45 |
46 |
47 | public void doNothing() {
48 | }
49 |
50 | public List createList() throws NegativeArraySizeException {
51 | return Collections.emptyList();
52 | }
53 |
54 | public List createListA() throws Exception {
55 | return Collections.emptyList();
56 | }
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/pkg02/ServiceImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.pkg02;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | import java.time.LocalDateTime;
36 | import java.util.Collections;
37 | import java.util.List;
38 |
39 | @StaticMetricsProxy
40 | public class ServiceImpl {
41 |
42 | public String doWork(String txt) {
43 | return txt + LocalDateTime.now();
44 | }
45 |
46 |
47 | public void doNothing() {
48 | }
49 |
50 | public List createList() throws NegativeArraySizeException {
51 | return Collections.emptyList();
52 | }
53 |
54 | public List createListA() throws Exception {
55 | return Collections.emptyList();
56 | }
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v001/BaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v001;
32 |
33 | public interface BaseInterface {
34 |
35 | String doWorkOnBase();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v001/Level1Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v001;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level1Interface extends BaseInterface {
37 |
38 | String doWorkOnLevel1();
39 | }
40 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v001/Level2Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v001;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level2Interface extends Level1Interface {
37 | String doWorkOnLevel2();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v001/Level3Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v001;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level3Interface extends Level2Interface {
37 | String doWorkOnLevel3();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v002/BaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v002;
32 |
33 | public interface BaseInterface {
34 |
35 | String doWorkOnBase();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v002/Level1Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v002;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level1Interface extends BaseInterface {
37 |
38 | String doWorkOnLevel1();
39 | }
40 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v002/Level2_A_Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v002;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level2_A_Interface extends Level1Interface {
37 | String doWorkOnLevel2();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v002/Level2_B_Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v002;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level2_B_Interface extends Level1Interface {
37 | String doWorkOnLevel2();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v003/BaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v003;
32 |
33 | public interface BaseInterface {
34 |
35 | String doWorkOnBase();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v003/Level1Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v003;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level1Interface extends BaseInterface {
37 |
38 | String doWorkOnLevel1();
39 | }
40 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v003/Level2Impl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v003;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public abstract class Level2Impl implements Level1Interface {
37 | public abstract String doWorkOnLevel2();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v003/Level3Impl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v003;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public abstract class Level3Impl extends Level2Impl {
37 | public abstract String doWorkOnLevel3();
38 |
39 | @Override
40 | public int hashCode() {
41 | return super.hashCode();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v004/BaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v004;
32 |
33 | public interface BaseInterface {
34 |
35 | String doWorkOnBase();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v004/Level1Interface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v004;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface Level1Interface extends BaseInterface {
37 |
38 | String doWorkOnLevel1();
39 | }
40 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v004/Level2Impl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v004;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public abstract class Level2Impl implements Level1Interface {
37 | public abstract String doWorkOnLevel2();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v004/Level3Impl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v004;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public abstract class Level3Impl extends Level2Impl {
37 | @Override
38 | public abstract String doWorkOnLevel2();
39 |
40 | @Override
41 | public int hashCode() {
42 | return super.hashCode();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v005/BaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v005;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public interface BaseInterface {
37 |
38 | String doWork(String str);
39 | }
40 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v006/BaseImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v006;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticVirtualProxy;
34 |
35 | @StaticVirtualProxy()
36 | public interface BaseImpl {
37 | String doWork(String txt);
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v007/MyConnection.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v007;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | import java.util.List;
36 |
37 |
38 | /**
39 | * Copyright (C) 2010 RapidPM
40 | * Licensed under the Apache License, Version 2.0 (the "License");
41 | * you may not use this file except in compliance with the License.
42 | * You may obtain a copy of the License at
43 | * http://www.apache.org/licenses/LICENSE-2.0
44 | * Unless required by applicable law or agreed to in writing, software
45 | * distributed under the License is distributed on an "AS IS" BASIS,
46 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | * See the License for the specific language governing permissions and
48 | * limitations under the License.
49 | *
50 | * Created by RapidPM - Team on 04.05.16.
51 | */
52 |
53 |
54 | @StaticMetricsProxy
55 | public interface MyConnection {
56 |
57 | T unwrap(java.lang.Class iface) throws java.sql.SQLException;
58 |
59 | T unwrapList(T type);
60 |
61 |
62 | // default String getDatabaseProductName() {
63 | // try {
64 | // return getMetaData().getDatabaseProductName() == null ? "" : getMetaData().getDatabaseProductName().toLowerCase();
65 | // } catch (SQLException e) {
66 | // e.printStackTrace();
67 | // return "";
68 | // }
69 | // }
70 |
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v008/LoggerExample.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v008;
32 |
33 | import java.sql.SQLException;
34 | import java.util.List;
35 |
36 | public class LoggerExample implements MyLoggingInterface {
37 |
38 |
39 | @Override
40 | public T unwrap(final Class iface) throws SQLException {
41 | return null;
42 | }
43 |
44 | @Override
45 | public T unwrapList(final T type) {
46 | return null;
47 | }
48 |
49 | @Override
50 | public T unwrapList(final T type, final String str) {
51 | return null;
52 | }
53 | }
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v008/MyLoggingInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v008;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
35 |
36 | import java.util.List;
37 |
38 | /**
39 | * Copyright (C) 2010 RapidPM
40 | * Licensed under the Apache License, Version 2.0 (the "License");
41 | * you may not use this file except in compliance with the License.
42 | * You may obtain a copy of the License at
43 | * http://www.apache.org/licenses/LICENSE-2.0
44 | * Unless required by applicable law or agreed to in writing, software
45 | * distributed under the License is distributed on an "AS IS" BASIS,
46 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | * See the License for the specific language governing permissions and
48 | * limitations under the License.
49 | *
50 | * Created by RapidPM - Team on 09.05.16.
51 | */
52 |
53 | @StaticLoggingProxy
54 | @StaticMetricsProxy
55 | public interface MyLoggingInterface {
56 |
57 | T unwrap(java.lang.Class iface) throws java.sql.SQLException;
58 |
59 | T unwrapList(T type);
60 | T unwrapList(T type, String str);
61 |
62 |
63 | // void unwrapVoid(java.lang.Class iface) throws java.sql.SQLException;
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v009/MyChildClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v009;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
35 |
36 | @StaticMetricsProxy
37 | @StaticLoggingProxy
38 | public class MyChildClass extends MyClass {
39 |
40 | public MyChildClass(String name) {
41 | super(name);
42 | }
43 |
44 | protected MyChildClass(final int i) {
45 | super(i);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v009/MyClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v009;
32 |
33 | public class MyClass {
34 |
35 | private String name = "";
36 |
37 | public MyClass(String name) {
38 | // Default constructor
39 | super();
40 | this.name = name;
41 | }
42 |
43 | protected MyClass(int i) {
44 |
45 | }
46 |
47 | private MyClass() {
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v010/MyClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v010;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 |
35 | @StaticLoggingProxy
36 | public interface MyClass {
37 |
38 | default void doSomething() {
39 | System.out.println("I did something");
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v011/FooImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v011;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
35 |
36 | /**
37 | * Created by b.bosch on 17.02.2016.
38 | */
39 | @StaticMetricsProxy
40 | @StaticLoggingProxy
41 | public class FooImpl implements FooLeft, FooRight {
42 | private final String name;
43 |
44 | protected FooImpl(final String name) {
45 | this.name = name;
46 | }
47 |
48 | // private FooImpl(String name) {
49 | // this.name = name;
50 | // }
51 |
52 | public static FooImpl getInstance(String name) {
53 | return new FooImpl(name);
54 | }
55 |
56 | @Override
57 | public void getLeft() {
58 |
59 |
60 | }
61 |
62 | @Override
63 | public void getRight() {
64 |
65 | }
66 |
67 | @Override
68 | public void getBar() {
69 |
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v011/FooLeft.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v011;
32 |
33 | /**
34 | * Created by b.bosch on 17.02.2016.
35 | */
36 | public interface FooLeft extends FooTop {
37 | void getLeft();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v011/FooRight.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v011;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy;
34 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
35 |
36 | /**
37 | * Created by b.bosch on 17.02.2016.
38 | */
39 | @StaticMetricsProxy
40 | @StaticLoggingProxy
41 | public interface FooRight extends FooTop {
42 | void getRight();
43 |
44 | static String doStaticWork(String txt){
45 | return "static-"+txt;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v011/FooTop.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v011;
32 |
33 | /**
34 | * Created by b.bosch on 17.02.2016.
35 | */
36 | public interface FooTop {
37 | void getBar();
38 | }
39 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v012/MyBaseClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v012;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public class MyBaseClass implements MyBaseInterface {
37 |
38 | @Override
39 | public final void doBaseWork() {
40 | System.out.println("base work");
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v012/MyBaseInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v012;
32 |
33 | public interface MyBaseInterface {
34 | void doBaseWork();
35 | }
36 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v012/MyClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v012;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public class MyClass {
37 |
38 | public final void doWork() {
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/testusage/src/main/java/org/rapidpm/proxybuilder/proxy/generated/v012/MyExtendedClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package org.rapidpm.proxybuilder.proxy.generated.v012;
32 |
33 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy;
34 |
35 | @StaticMetricsProxy
36 | public class MyExtendedClass extends MyBaseClass {
37 |
38 | public void doWorkA() {
39 | }
40 |
41 | public void doWorkB() {
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/testusage/src/main/kotlin/org/rapidpm/proxybuilder/proxy/generated/v005/KotlinImpl.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.generated.v005
17 |
18 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy
19 | import org.rapidpm.proxybuilder.proxy.generated.v005.BaseInterface
20 |
21 | /**
22 | * Copyright (C) 2015 RapidPM
23 | * Licensed under the Apache License, Version 2.0 (the "License");
24 | * you may not use this file except in compliance with the License.
25 | * You may obtain a copy of the License at
26 | * http://www.apache.org/licenses/LICENSE-2.0
27 | * Unless required by applicable law or agreed to in writing, software
28 | * distributed under the License is distributed on an "AS IS" BASIS,
29 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 | * See the License for the specific language governing permissions and
31 | * limitations under the License.
32 | *
33 | * Created by RapidPM - Team on 18.02.16.
34 | */
35 | @StaticMetricsProxy
36 | class KotlinImpl() : BaseInterface {
37 |
38 | override fun doWork(str: String?): String? {
39 | throw UnsupportedOperationException()
40 | }
41 | }
--------------------------------------------------------------------------------
/testusage/src/main/kotlin/org/rapidpm/proxybuilder/proxy/generated/v008/kotlin/MyLoggingInterface.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.rapidpm.proxybuilder.proxy.generated.v008.kotlin
17 |
18 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticLoggingProxy
19 | import org.rapidpm.proxybuilder.proxy.generated.annotations.StaticMetricsProxy
20 |
21 | /**
22 | * Copyright (C) 2010 RapidPM
23 | * Licensed under the Apache License, Version 2.0 (the "License");
24 | * you may not use this file except in compliance with the License.
25 | * You may obtain a copy of the License at
26 | * http://www.apache.org/licenses/LICENSE-2.0
27 | * Unless required by applicable law or agreed to in writing, software
28 | * distributed under the License is distributed on an "AS IS" BASIS,
29 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 | * See the License for the specific language governing permissions and
31 | * limitations under the License.
32 | *
33 | * Created by RapidPM - Team on 09.05.16.
34 | */
35 |
36 | @StaticLoggingProxy
37 | @StaticMetricsProxy
38 | interface MyLoggingInterface {
39 |
40 | @Throws(java.sql.SQLException::class)
41 | fun unwrap(iface: Class): T
42 |
43 | fun > unwrapList(type: T): T
44 | fun > unwrapList(type: T, str: String): T
45 |
46 |
47 | // void unwrapVoid(java.lang.Class iface) throws java.sql.SQLException;
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/testusage/src/test/java/demo/reflections/Inject.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package demo.reflections;
32 |
33 | public @interface Inject {
34 | }
35 |
--------------------------------------------------------------------------------
/testusage/src/test/java/demo/reflections/ReflectionsDemo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package demo.reflections;
32 |
33 | import org.reflections8.Reflections;
34 | import org.reflections8.scanners.*;
35 | import org.reflections8.util.ClasspathHelper;
36 | import org.reflections8.util.ConfigurationBuilder;
37 | import org.reflections8.util.FilterBuilder;
38 |
39 | import java.lang.reflect.Field;
40 | import java.util.Arrays;
41 | import java.util.Collections;
42 | import java.util.Set;
43 |
44 | public class ReflectionsDemo {
45 |
46 |
47 | public static void main(String[] args) {
48 | final FilterBuilder TestModelFilter = new FilterBuilder().include("demo.*.model.*");
49 |
50 | final Reflections reflections = new Reflections(new ConfigurationBuilder()
51 | .setUrls(Collections.singletonList(ClasspathHelper.forClass(ReflectionsDemo.class)))
52 | .filterInputsBy(TestModelFilter)
53 | .setScanners(
54 | new SubTypesScanner(false),
55 | new TypeAnnotationsScanner(),
56 | new FieldAnnotationsScanner(),
57 | new MethodAnnotationsScanner(),
58 | new MethodParameterScanner(),
59 | new MethodParameterNamesScanner(),
60 | new MemberUsageScanner()));
61 |
62 | frageFindeAlleInjectsMitMultiplizitaeten(reflections);
63 |
64 | }
65 |
66 | private static void frageFindeAlleInjectsMitMultiplizitaeten(Reflections reflections) {
67 |
68 | final Set allTypes = reflections.getAllTypes();
69 | allTypes.forEach(System.out::println);
70 |
71 | final Set fieldsAnnotatedWith = reflections.getFieldsAnnotatedWith(Inject.class);
72 | for (final Field field : fieldsAnnotatedWith) {
73 | final Class> type = field.getType();
74 | final Set extends Class>> subTypesOf = reflections.getSubTypesOf(type);
75 | if (subTypesOf.size() > 1) {
76 |
77 | System.out.println("field = " + field);
78 | } else {
79 | }
80 | }
81 |
82 |
83 | }
84 |
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/testusage/src/test/java/demo/reflections/model/model_a/Model_A.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package demo.reflections.model.model_a;
32 |
33 | import demo.reflections.Inject;
34 |
35 | import javax.annotation.PostConstruct;
36 |
37 | public class Model_A {
38 |
39 |
40 | public interface Service {
41 | String work(String txt);
42 |
43 | SubService getSubService();
44 |
45 | boolean isPostconstructed();
46 | }
47 |
48 | public static class BusinessModule {
49 |
50 | @Inject
51 | Service service;
52 |
53 | public String work(String txt) {
54 | return service.work(txt);
55 | }
56 | }
57 |
58 | public static class ServiceImplA implements Service {
59 | @Inject
60 | SubService subService;
61 | boolean postconstructed;
62 |
63 | public String work(String txt) {
64 | return subService.work(txt);
65 | }
66 |
67 | @PostConstruct
68 | public void postconstruct() {
69 | postconstructed = true;
70 | } @Override
71 | public SubService getSubService() {
72 | return subService;
73 | }
74 |
75 | public boolean isPostconstructed() {
76 | return postconstructed;
77 | }
78 |
79 |
80 | }
81 |
82 | public static class ServiceImplB implements Service {
83 | @Inject
84 | SubService subService;
85 | boolean postconstructed;
86 |
87 | @PostConstruct
88 | public void postconstruct() {
89 | postconstructed = true;
90 | } public String work(String txt) {
91 | return subService.work(txt);
92 | }
93 |
94 | @Override
95 | public SubService getSubService() {
96 | return subService;
97 | }
98 |
99 | public boolean isPostconstructed() {
100 | return postconstructed;
101 | }
102 |
103 |
104 | }
105 |
106 |
107 | public static class SubService {
108 | @Inject
109 | SubSubService subSubService;
110 | boolean postconstructed;
111 |
112 | public String work(final String txt) {
113 | return subSubService.work(txt);
114 | }
115 |
116 | public boolean isPostconstructed() {
117 | return postconstructed;
118 | }
119 |
120 | @PostConstruct
121 | public void postconstruct() {
122 | postconstructed = true;
123 | }
124 | }
125 |
126 |
127 | public static class SubSubService {
128 | public String work(final String txt) {
129 | return "SubSubService " + txt;
130 | }
131 | }
132 |
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/DemoClassA.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public class DemoClassA implements DemoInterface {
34 | public DemoClassB demoClassB;
35 |
36 | public DemoClassB getDemoClassB() {
37 | return demoClassB;
38 | }
39 |
40 | @Override
41 | public String doSomething() {
42 | return null;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/DemoClassB.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public class DemoClassB {
34 | public String value;
35 |
36 | public DemoClassC demoClassC;
37 |
38 | public DemoClassC getDemoClassC() {
39 | return demoClassC;
40 | }
41 |
42 | public void setDemoClassC(DemoClassC demoClassC) {
43 | this.demoClassC = demoClassC;
44 | }
45 |
46 | public String getValue() {
47 | return value;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/DemoClassC.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public class DemoClassC {
34 |
35 | public String value = "demoClassC";
36 |
37 | public String getValue() {
38 | return value;
39 | }
40 |
41 | public void setValue(String value) {
42 | this.value = value;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/DemoInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public interface DemoInterface {
34 | String doSomething();
35 | }
36 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/DemoLogic.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public class DemoLogic implements DemoInterface {
34 |
35 | public String value;
36 |
37 | @Override
38 | public String doSomething() {
39 | final String result = "doSomething-> DemoLogic";
40 | System.out.println(result);
41 | return result;
42 | }
43 |
44 | public String getSomething() {
45 | return "nooop";
46 | }
47 |
48 | public String getValue() {
49 | return value;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/model/FinalDemoLogic.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.model;
32 |
33 | public final class FinalDemoLogic extends DemoLogic {
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/AddPreActionTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic;
32 |
33 | import org.junit.Assert;
34 | import org.junit.Test;
35 | import org.rapidpm.proxybuilder.proxy.dymamic.DynamicProxyBuilder;
36 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.CreationStrategy;
37 |
38 | import java.util.ArrayList;
39 | import java.util.HashMap;
40 | import java.util.List;
41 | import java.util.Map;
42 |
43 | public class AddPreActionTest {
44 |
45 |
46 | @Test
47 | public void test001() throws Exception {
48 | final DemoService build = DynamicProxyBuilder
49 | .createBuilder(DemoService.class, DemoServiceImplementation.class, CreationStrategy.NONE)
50 | .addIPreAction((original, method, args) -> {
51 | System.out.println("original = " + original);
52 | })
53 | .build();
54 | Assert.assertEquals("hhimpl", build.doWork("hh"));
55 | }
56 |
57 | @Test
58 | public void test002() throws Exception {
59 | final List done = new ArrayList<>();
60 |
61 | final Map build = DynamicProxyBuilder
62 | .createBuilder(Map.class, HashMap.class, CreationStrategy.NONE)
63 | .addIPreAction((original, method, args) -> {
64 | System.out.println("original = " + original);
65 | done.add(true);
66 | })
67 | .build();
68 | Assert.assertTrue(done.isEmpty());
69 | final int size = build.size();
70 | Assert.assertFalse(done.isEmpty());
71 | }
72 |
73 | public interface DemoService {
74 | String doWork(String txt);
75 | }
76 |
77 | public static class DemoServiceImplementation implements DemoService {
78 | @Override
79 | public String doWork(final String txt) {
80 | return txt + "impl";
81 | }
82 | }
83 |
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/DynamicLoggingProxyTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic;
32 |
33 | import org.junit.Test;
34 | import org.rapidpm.proxybuilder.proxy.dymamic.DynamicProxyBuilder;
35 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.CreationStrategy;
36 |
37 | /**
38 | * Copyright (C) 2010 RapidPM
39 | * Licensed under the Apache License, Version 2.0 (the "License");
40 | * you may not use this file except in compliance with the License.
41 | * You may obtain a copy of the License at
42 | * http://www.apache.org/licenses/LICENSE-2.0
43 | * Unless required by applicable law or agreed to in writing, software
44 | * distributed under the License is distributed on an "AS IS" BASIS,
45 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46 | * See the License for the specific language governing permissions and
47 | * limitations under the License.
48 | *
49 | * Created by RapidPM - Team on 11.05.16.
50 | */
51 | public class DynamicLoggingProxyTest {
52 |
53 |
54 | @Test
55 | public void test001() throws Exception {
56 | final InnerDemoInterface proxy = DynamicProxyBuilder
57 | .createBuilder(
58 | InnerDemoInterface.class,
59 | InnerDemoClass.class,
60 | CreationStrategy.NONE)
61 | .addLogging()
62 | .build();
63 | System.out.println("System.nanoTime() = " + System.nanoTime());
64 | final String s = proxy.doWork();
65 | System.out.println("System.nanoTime() = " + System.nanoTime());
66 | }
67 |
68 | @Test
69 | public void test002() throws Exception {
70 | final DemoInterface proxy = DynamicProxyBuilder
71 | .createBuilder(
72 | DemoInterface.class,
73 | Demo.class,
74 | CreationStrategy.NONE)
75 | .addLogging()
76 | .build();
77 | System.out.println("System.nanoTime() = " + System.nanoTime());
78 | final String s = proxy.doWork("cc");
79 | System.out.println("System.nanoTime() = " + System.nanoTime());
80 | }
81 |
82 |
83 | public interface DemoInterface {
84 | String doWork(String txt);
85 | }
86 |
87 | public static class Demo implements DemoInterface {
88 | public String doWork(String txt) {
89 | return "XX" + txt;
90 | }
91 | }
92 |
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/DynamicProxyGeneratorVirtualTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic;
32 |
33 | import junit.org.rapidpm.proxybuilder.model.DemoInterface;
34 | import junit.org.rapidpm.proxybuilder.model.DemoLogic;
35 | import org.junit.Assert;
36 | import org.junit.Test;
37 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.CreationStrategy;
38 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.DefaultConstructorServiceFactory;
39 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.DynamicProxyGenerator;
40 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.DynamicProxyGenerator.Builder;
41 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.factory.ServiceFactory;
42 |
43 | public class DynamicProxyGeneratorVirtualTest {
44 |
45 |
46 | @Test
47 | public void test001() throws Exception {
48 | final DynamicProxyGenerator build = createBuilder4DemoLogic()
49 | .withCreationStrategy(CreationStrategy.NONE)
50 | .build();
51 | final DemoInterface demoInterface = build.make();
52 |
53 |
54 | Assert.assertNotNull(demoInterface);
55 | Assert.assertEquals("doSomething-> DemoLogic", demoInterface.doSomething());
56 | }
57 |
58 | private Builder createBuilder4DemoLogic() {
59 | return DynamicProxyGenerator.newBuilder()
60 | .withSubject(DemoInterface.class)
61 | .withServiceFactory(new DefaultConstructorServiceFactory<>(DemoLogic.class));
62 | }
63 |
64 | @Test
65 | public void test002() throws Exception {
66 |
67 | final ServiceFactory serviceFactory = () -> {
68 | DemoLogic newInstance = null;
69 | try {
70 | newInstance = DemoLogic.class.newInstance();
71 | } catch (InstantiationException | IllegalAccessException e) {
72 | e.printStackTrace();
73 | }
74 | return newInstance;
75 | };
76 |
77 | final DemoInterface demoInterface = createBuilder4DemoLogic()
78 | .withCreationStrategy(CreationStrategy.NONE)
79 | .withServiceFactory(serviceFactory)
80 | .build()
81 | .make();
82 |
83 | Assert.assertNotNull(demoInterface);
84 | Assert.assertEquals("doSomething-> DemoLogic", demoInterface.doSomething());
85 | }
86 |
87 | @Test
88 | public void test003() throws Exception {
89 |
90 | final DemoInterface demoInterface = createBuilder4DemoLogic()
91 | .withCreationStrategy(CreationStrategy.NONE)
92 | .withServiceFactory(new MyServiceFactory())
93 | .build()
94 | .make();
95 |
96 | Assert.assertNotNull(demoInterface);
97 | Assert.assertEquals("doSomething-> DemoLogic", demoInterface.doSomething());
98 | }
99 |
100 | private static class MyServiceFactory implements ServiceFactory {
101 |
102 | @Override
103 | public DemoLogic createInstance() {
104 | DemoLogic newInstance = null;
105 | try {
106 | newInstance = DemoLogic.class.newInstance();
107 | } catch (InstantiationException | IllegalAccessException e) {
108 | e.printStackTrace();
109 | }
110 | return newInstance;
111 | }
112 | }
113 |
114 |
115 | }
116 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/InnerDemoClass.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic;
32 |
33 | public class InnerDemoClass implements InnerDemoInterface {
34 |
35 | public InnerDemoClass() {
36 | System.out.println("InnerDemoClass = init " + System.nanoTime());
37 | }
38 |
39 | @Override
40 | public String doWork() {
41 | return "InnerDemoClass.doWork()";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/InnerDemoInterface.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic;
32 |
33 | public interface InnerDemoInterface {
34 | String doWork();
35 | }
36 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/virtual/DynamicVirtualproxyTest001.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic.virtual;
32 |
33 | import org.junit.Assert;
34 | import org.junit.Test;
35 | import org.rapidpm.proxybuilder.proxy.dymamic.DynamicProxyBuilder;
36 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.CreationStrategy;
37 |
38 |
39 | public class DynamicVirtualproxyTest001 {
40 |
41 |
42 | @Test(expected = MyException.class)
43 | public void test001() throws Exception {
44 | final Service service = DynamicProxyBuilder
45 | .createBuilder(Service.class, MyService.class, CreationStrategy.NONE)
46 | .build();
47 | work(service);
48 | }
49 |
50 | private void work(final Service service) throws MyException {
51 | try {
52 | service.doWork();
53 | } catch (MyException e) {
54 | Assert.assertNotNull(e);
55 | Assert.assertEquals(MyException.class, e.getClass());
56 | throw e;
57 | }
58 | }
59 |
60 | @Test(expected = MyException.class)
61 | public void test002() throws Exception {
62 | final Service service = DynamicProxyBuilder
63 | .createBuilder(Service.class, MyService.class, CreationStrategy.NONE)
64 | .addMetrics()
65 | .build();
66 | work(service);
67 | }
68 |
69 | @Test(expected = MyException.class)
70 | public void test003() throws Exception {
71 | final Service service = DynamicProxyBuilder
72 | .createBuilder(Service.class, MyService.class, CreationStrategy.NONE)
73 | .addSecurityRule(()->true)
74 | .build();
75 |
76 | work(service);
77 | }
78 |
79 | @Test(expected = MyException.class)
80 | public void test004() throws Exception {
81 | final Service service = DynamicProxyBuilder
82 | .createBuilder(Service.class, MyService.class, CreationStrategy.NONE)
83 | .addSecurityRule(()->true)
84 | .addMetrics()
85 | .build();
86 |
87 | work(service);
88 | }
89 |
90 | @Test(expected = MyException.class)
91 | public void test005() throws Exception {
92 | final Service service = DynamicProxyBuilder
93 | .createBuilder(Service.class, MyService.class, CreationStrategy.NONE)
94 | .addSecurityRule(()->true)
95 | .addMetrics()
96 | .addIPreAction((original, method, args) -> {
97 | throw new MyException();
98 | })
99 | .build();
100 |
101 | work(service);
102 | }
103 |
104 | public interface Service {
105 | String doWork() throws MyException;
106 | }
107 |
108 | public static class MyException extends Exception {
109 |
110 | }
111 |
112 | public static class MyService implements Service {
113 | @Override
114 | public String doWork() throws MyException {
115 |
116 | System.out.println("MyService = " + true);
117 |
118 | throw new MyException();
119 | }
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/dynamic/virtual/methodscoped/v001/MethodScopedTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.dynamic.virtual.methodscoped.v001;
32 |
33 | import org.junit.Assert;
34 | import org.junit.Test;
35 | import org.rapidpm.proxybuilder.proxy.dymamic.DynamicProxyBuilder;
36 | import org.rapidpm.proxybuilder.proxy.dymamic.virtual.strategy.CreationStrategy;
37 |
38 | public class MethodScopedTest {
39 |
40 |
41 | static int constructorCounter = 0;
42 |
43 |
44 | @Test
45 | public void test001() throws Exception {
46 |
47 | final Service service = DynamicProxyBuilder
48 | .createBuilder(Service.class, ServiceImpl.class, CreationStrategy.METHOD_SCOPED)
49 | .build();
50 |
51 | service.doWork("");
52 | Assert.assertEquals(1, constructorCounter);
53 |
54 | service.doWork("");
55 | Assert.assertEquals(2, constructorCounter);
56 |
57 | service.doWork("");
58 | Assert.assertEquals(3, constructorCounter);
59 | }
60 |
61 |
62 | public interface Service {
63 | String doWork(String txt);
64 | }
65 |
66 | public static class ServiceImpl implements Service {
67 |
68 | public ServiceImpl() {
69 | constructorCounter += 1;
70 | }
71 |
72 | @Override
73 | public String doWork(final String txt) {
74 | return txt + " - impl";
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/proxy/generated/v008/MyLoggingInterfaceTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.proxy.generated.v008;
32 |
33 | import org.junit.jupiter.api.Test;
34 | import org.rapidpm.proxybuilder.proxy.generated.v008.LoggerExample;
35 | import org.rapidpm.proxybuilder.proxy.generated.v008.MyLoggingInterface;
36 | import org.rapidpm.proxybuilder.proxy.generated.v008.MyLoggingInterfaceStaticLoggingProxy;
37 |
38 | import java.util.List;
39 |
40 | import static java.util.Arrays.asList;
41 |
42 | class MyLoggingInterfaceTest {
43 |
44 |
45 | @Test
46 | void test001() {
47 | final MyLoggingInterface demo = new MyLoggingInterfaceStaticLoggingProxy()
48 | .withDelegator(new LoggerExample());
49 |
50 | final List list = demo
51 | .unwrapList(asList(1, 2, 3, 4), "AEAEA");
52 | //
53 | }
54 | }
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/ClassPathScanner.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection;
32 |
33 | import java.io.File;
34 | import java.io.UnsupportedEncodingException;
35 | import java.net.URL;
36 | import java.net.URLDecoder;
37 | import java.util.*;
38 |
39 | public class ClassPathScanner {
40 |
41 | public List scannForClasses() {
42 | return new ArrayList<>();
43 | }
44 |
45 | public ClassLoader[] classLoaders(ClassLoader... classLoaders) {
46 | if (classLoaders != null && classLoaders.length != 0) {
47 | return classLoaders;
48 | } else {
49 | ClassLoader contextClassLoader = contextClassLoader();
50 | ClassLoader staticClassLoader = staticClassLoader();
51 | if (contextClassLoader != null)
52 | if (staticClassLoader != null && contextClassLoader != staticClassLoader)
53 | return new ClassLoader[]{contextClassLoader, staticClassLoader};
54 | else return new ClassLoader[]{contextClassLoader};
55 | else return new ClassLoader[]{};
56 | }
57 | }
58 |
59 | public ClassLoader contextClassLoader() {
60 | return Thread.currentThread().getContextClassLoader();
61 | }
62 |
63 | public ClassLoader staticClassLoader() {
64 | return ClassPathScanner.class.getClassLoader();
65 | }
66 |
67 | public Collection forJavaClassPath() {
68 | Collection urls = new ArrayList<>();
69 | String javaClassPath = System.getProperty("java.class.path");
70 | if (javaClassPath != null) {
71 | for (String path : javaClassPath.split(File.pathSeparator)) {
72 | try {
73 | urls.add(new File(path).toURI().toURL());
74 | } catch (Exception e) {
75 | //Todo logging
76 | }
77 | }
78 | }
79 | return distinctUrls(urls);
80 | }
81 |
82 | private Collection distinctUrls(Collection urls) {
83 | Map distinct = new HashMap<>(urls.size());
84 | for (URL url : urls) {
85 | distinct.put(url.toExternalForm(), url);
86 | }
87 | return distinct.values();
88 | }
89 |
90 |
91 | public String cleanPath(final URL url) {
92 | String path = url.getPath();
93 | try {
94 | path = URLDecoder.decode(path, "UTF-8");
95 | } catch (UnsupportedEncodingException e) { /**/ }
96 | if (path.startsWith("jar:")) {
97 | path = path.substring("jar:".length());
98 | }
99 | if (path.startsWith("file:")) {
100 | path = path.substring("file:".length());
101 | }
102 | if (path.endsWith("!/")) {
103 | path = path.substring(0, path.lastIndexOf("!/")) + "/";
104 | }
105 | return path;
106 | }
107 |
108 | private String resourceName(String name) {
109 | if (name != null) {
110 | String resourceName = name.replace(".", "/");
111 | resourceName = resourceName.replace("\\", "/");
112 | if (resourceName.startsWith("/")) {
113 | resourceName = resourceName.substring(1);
114 | }
115 | return resourceName;
116 | }
117 | return null;
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/PackageClassLoader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection;
32 |
33 | import java.io.File;
34 | import java.io.IOException;
35 | import java.net.URL;
36 | import java.util.ArrayList;
37 | import java.util.Enumeration;
38 | import java.util.List;
39 |
40 | /**
41 | * User: Sven Ruppert
42 | * Date: 10.06.13
43 | * Time: 07:39
44 | */
45 | public class PackageClassLoader {
46 |
47 | public List getClasses(String packageName) {
48 | final List result = new ArrayList<>();
49 |
50 | final ClassLoader[] classLoaders = classLoaders();
51 | for (final ClassLoader classLoader : classLoaders) {
52 | assert classLoader != null;
53 | final String path = packageName.replace('.', '/');
54 | final List classes;
55 | try {
56 | final Enumeration resources = classLoader.getResources(path);
57 | final List dirs = new ArrayList<>();
58 | while (resources.hasMoreElements()) {
59 | final URL resource = resources.nextElement();
60 | dirs.add(new File(resource.getFile()));
61 | }
62 | classes = new ArrayList<>();
63 | for (final File directory : dirs) {
64 | classes.addAll(findClasses(directory, packageName));
65 | }
66 | result.addAll(classes);
67 | } catch (IOException e) {
68 | //TODO logger.error(e);
69 | // return new Class[0];
70 | } catch (ClassNotFoundException e) {
71 | //TODO logger.error(e);
72 | // return new Class[0];
73 | }
74 | // classes.toArray(new Class[classes.size()])
75 | }
76 | return result;
77 | }
78 |
79 | private List findClasses(File directory, String packageName) throws ClassNotFoundException {
80 | final List classes = new ArrayList<>();
81 | if (!directory.exists()) {
82 | return classes;
83 | }
84 | final File[] files = directory.listFiles();
85 | for (final File file : files) {
86 | if (file.isDirectory()) {
87 | assert !file.getName().contains(".");
88 | classes.addAll(findClasses(file, packageName + "." + file.getName()));
89 | } else if (file.getName().endsWith(".class")) {
90 | classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));
91 | }
92 | }
93 | return classes;
94 | }
95 |
96 |
97 | public ClassLoader contextClassLoader() {
98 | return Thread.currentThread().getContextClassLoader();
99 | }
100 |
101 | public ClassLoader staticClassLoader() {
102 | return ClassPathScanner.class.getClassLoader();
103 | }
104 |
105 | public ClassLoader[] classLoaders(ClassLoader... classLoaders) {
106 | if (classLoaders != null && classLoaders.length != 0) {
107 | return classLoaders;
108 | } else {
109 | ClassLoader contextClassLoader = contextClassLoader();
110 | ClassLoader staticClassLoader = staticClassLoader();
111 | if (contextClassLoader != null)
112 | if (staticClassLoader != null && contextClassLoader != staticClassLoader)
113 | return new ClassLoader[]{contextClassLoader, staticClassLoader};
114 | else return new ClassLoader[]{contextClassLoader};
115 | else return new ClassLoader[]{};
116 | }
117 | }
118 |
119 | }
120 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/PackageClassLoaderTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection;
32 |
33 | import org.junit.Test;
34 |
35 | import java.util.List;
36 |
37 | public class PackageClassLoaderTest {
38 |
39 |
40 | @Test
41 | public void testLoad001() throws Exception {
42 | final PackageClassLoader loader = new PackageClassLoader();
43 | final List classes = loader.getClasses("junit.org.rapidpm.proxybuilder.reflection.test001");
44 | for (final Class aClass : classes) {
45 | System.out.println("aClass = " + aClass);
46 | }
47 |
48 | }
49 |
50 | @Test
51 | public void testLoad002() throws Exception {
52 | final PackageClassLoader loader = new PackageClassLoader();
53 | final List classes = loader.getClasses("org.jboss.weld");
54 | for (final Class aClass : classes) {
55 | System.out.println("aClass = " + aClass);
56 | }
57 |
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/test001/KlasseA.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection.test001;
32 |
33 | public class KlasseA {
34 | }
35 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/test001/KlasseB.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection.test001;
32 |
33 | public class KlasseB {
34 | }
35 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/test001/a/KlasseA.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection.test001.a;
32 |
33 | public class KlasseA {
34 | }
35 |
--------------------------------------------------------------------------------
/testusage/src/test/java/junit/org/rapidpm/proxybuilder/reflection/test001/a/KlasseB.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | /*
17 | Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 | */
31 | package junit.org.rapidpm.proxybuilder.reflection.test001.a;
32 |
33 | public class KlasseB {
34 | }
35 |
--------------------------------------------------------------------------------