23 | consul.1.host.port=
24 | # Consul 资源URL
25 | consul.1.url=
26 | # Consul权限验证用户名
27 | consul.1.username=
28 | # Consul权限验证密码
29 | consul.1.password=
30 | # Consul ACLs token
31 | consul.1.token=
32 | # Consul 请求头参数列表, JSON数据格式
33 | consul.1.headers=
34 | # 连接超时时长, 单位: 毫秒
35 | consul.1.timeout.connect=3000
36 | # 读取超时时长,单位: 毫秒
37 | consul.1.timeout.read=60000
38 | # 写入超时时长, 单位: 毫秒
39 | conusl.1.timeout.write=5000
40 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/java/org/nanoframework/concurrent/rocketmq/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/java/org/nanoframework/concurrent/rocketmq/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/java/org/nanoframework/concurrent/rocketmq/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/java/org/nanoframework/concurrent/rocketmq/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/Cluster.graffle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/Cluster.graffle
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/main/java/org/nanoframework/concurrent/scheduler/loader/SchedulerLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.concurrent.scheduler.loader;
17 |
18 | import org.nanoframework.core.spi.Lazy;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.4.8
24 | */
25 | @Lazy
26 | public interface SchedulerLoader {
27 |
28 | /**
29 | *
30 | * 加载任务.
31 | */
32 | void load();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/main/java/org/nanoframework/concurrent/scheduler/single/SchedulerShutdownHook.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.concurrent.scheduler.single;
17 |
18 | import org.nanoframework.concurrent.scheduler.SchedulerFactory;
19 |
20 | /**
21 | *
22 | *
23 | * @author yanghe
24 | * @since 1.4.8
25 | */
26 | public class SchedulerShutdownHook implements Runnable {
27 | private final SchedulerFactory factory;
28 |
29 | public SchedulerShutdownHook(final SchedulerFactory factory) {
30 | this.factory = factory;
31 | }
32 |
33 | @Override
34 | public void run() {
35 | factory.destory();
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/main/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/main/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin:
--------------------------------------------------------------------------------
1 | org.nanoframework.concurrent.scheduler.SchedulerPlugin
2 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/SchedulerSuite.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.concurrent.scheduler;
17 |
18 | import org.junit.runner.RunWith;
19 | import org.junit.runners.Suite;
20 |
21 | /**
22 | * @author yanghe
23 | * @since 1.4.9
24 | */
25 | @RunWith(Suite.class)
26 | @Suite.SuiteClasses({
27 | org.nanoframework.concurrent.scheduler.tests.SchedulerTests.class,
28 | org.nanoframework.concurrent.scheduler.longwait.SchedulerTests.class
29 | })
30 | public class SchedulerSuite {
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/test/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/test/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/test/resources/longwait-context.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2015-2016 the original author or authors.
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 | context=
18 |
19 | context.version=0.0.1
20 |
21 | context.mode=DEV
22 |
23 | context.root=/concurrent
24 |
25 | context.scheduler-scan.base-package=org.nanoframework.concurrent.scheduler.longwait
26 |
--------------------------------------------------------------------------------
/nano-concurrent-parent/nano-concurrent/src/test/resources/test-context.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2015-2016 the original author or authors.
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 | context=
18 |
19 | context.version=0.0.1
20 |
21 | context.mode=DEV
22 |
23 | context.root=/concurrent
24 |
25 | context.scheduler-scan.base-package=org.nanoframework.concurrent.scheduler.tests
26 |
--------------------------------------------------------------------------------
/nano-core/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/After.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface After {
32 | Class extends IAfter> value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/AfterMore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface AfterMore {
32 | After[] value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/Before.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface Before {
32 | Class extends IBefore> value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeAndAfter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface BeforeAndAfter {
32 | Class extends IBeforeAndAfter> value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeAndAfterMore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface BeforeAndAfterMore {
32 | BeforeAndAfter[] value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeMore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Target({ ElementType.METHOD })
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Documented
31 | public @interface BeforeMore {
32 | Before[] value();
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/IAfter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import org.aopalliance.intercept.MethodInvocation;
19 |
20 | /**
21 | * @author yanghe
22 | * @since 1.0
23 | */
24 | public interface IAfter {
25 | void after(MethodInvocation invocation, Object result);
26 | }
27 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/IBefore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import org.aopalliance.intercept.MethodInvocation;
19 |
20 | /**
21 | * @author yanghe
22 | * @since 1.0
23 | */
24 | public interface IBefore {
25 | void before(MethodInvocation invocation);
26 | }
27 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/IBeforeAndAfter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | /**
19 | * @author yanghe
20 | * @since 1.0
21 | */
22 | public interface IBeforeAndAfter extends IBefore, IAfter {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/aop/MethodNames.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | /**
19 | * @author yanghe
20 | * @since 1.0
21 | */
22 | public final class MethodNames {
23 | protected static final String BEFORE = "before";
24 | protected static final String AFTER = "after";
25 |
26 | private MethodNames() {
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/exception/ComponentServiceRepeatException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.exception;
17 |
18 | /**
19 | * 重复组件服务异常
20 | *
21 | * @author yanghe
22 | * @since 1.0
23 | */
24 | public class ComponentServiceRepeatException extends RuntimeException {
25 | private static final long serialVersionUID = -4050783744076776903L;
26 |
27 | public ComponentServiceRepeatException() {
28 |
29 | }
30 |
31 | public ComponentServiceRepeatException(String message) {
32 | super(message);
33 | }
34 |
35 | public ComponentServiceRepeatException(String message, Throwable cause) {
36 | super(message, cause);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/PathVariable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.stereotype.bind;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.0
28 | */
29 | @Target(ElementType.PARAMETER)
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Documented
32 | public @interface PathVariable {
33 |
34 | /**
35 | *
36 | * @return The URI template variable to bind to.
37 | */
38 | String value() default "";
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/RequestMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.stereotype.bind;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.0
22 | */
23 | public enum RequestMethod {
24 | GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, PATCH
25 |
26 | }
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/ValueConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.stereotype.bind;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.0
22 | */
23 | public interface ValueConstants {
24 |
25 | /**
26 | * Constant defining a value for no default - as a replacement for
27 | * null
which we cannot use in annotation attributes.
28 | * This is an artificial arrangement of 16 unicode characters,
29 | * with its sole purpose being to never match user-declared values.
30 | * @see RequestParam#defaultValue()
31 | */
32 | String DEFAULT_NONE = "\n\t\t\n\t\t\n\uE000\uE001\uE002\n\t\t\t\t\n";
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/globals/Globals.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.globals;
17 |
18 | import java.util.concurrent.ConcurrentMap;
19 |
20 | import com.google.common.collect.Maps;
21 |
22 | /**
23 | * 全局变量,针对一些全局的属性做统一管理.
24 | * @author yanghe
25 | * @since 1.0
26 | */
27 | public final class Globals {
28 | private static final ConcurrentMap, Object> GLOBALS = Maps.newConcurrentMap();
29 |
30 | private Globals() {
31 |
32 | }
33 |
34 | public static void set(final Class> clz, final Object global) {
35 | GLOBALS.put(clz, global);
36 | }
37 |
38 | @SuppressWarnings("unchecked")
39 | public static final T get(final Class clz) {
40 | return (T) GLOBALS.get(clz);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/inject/API.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.inject;
17 |
18 | import static java.lang.annotation.ElementType.TYPE;
19 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
20 |
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.2
28 | */
29 | @Retention(RUNTIME)
30 | @Target(TYPE)
31 | public @interface API {
32 | String value() default "";
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/inject/BindException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.inject;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.2
22 | */
23 | public class BindException extends RuntimeException {
24 | private static final long serialVersionUID = 5383088197972897359L;
25 |
26 | public BindException(final String message) {
27 | super(message);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/inject/FieldInject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.inject;
17 |
18 | import com.google.inject.MembersInjector;
19 |
20 | import java.lang.annotation.Documented;
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * @author yanghe
28 | * @since 1.4.10
29 | */
30 | @Documented
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Target({ElementType.FIELD, ElementType.METHOD})
33 | public @interface FieldInject {
34 | /**
35 | * @return 自定义Field依赖注入实现
36 | */
37 | Class extends MembersInjector> value();
38 | }
39 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/plugins/Module.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.plugins;
17 |
18 | import java.util.List;
19 |
20 | import javax.servlet.ServletConfig;
21 |
22 | import org.nanoframework.core.spi.Lazy;
23 |
24 | /**
25 | * @author yanghe
26 | * @since 1.1
27 | */
28 | @Lazy
29 | public interface Module extends com.google.inject.Module {
30 | List load() throws Throwable;
31 |
32 | void config(ServletConfig config) throws Throwable;
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/plugins/Plugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.plugins;
17 |
18 | import javax.servlet.ServletConfig;
19 |
20 | import org.nanoframework.core.spi.Lazy;
21 |
22 | /**
23 | * @author yanghe
24 | * @since 1.1
25 | */
26 | @Lazy
27 | public interface Plugin {
28 | boolean load() throws Throwable;
29 |
30 | void config(ServletConfig config) throws Throwable;
31 | }
32 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/plugins/PluginLoaderException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.plugins;
17 |
18 | /**
19 | * @author yanghe
20 | * @since 1.1
21 | */
22 | public class PluginLoaderException extends RuntimeException {
23 | private static final long serialVersionUID = -3388677411268525198L;
24 |
25 | public PluginLoaderException() {
26 | super();
27 | }
28 |
29 | public PluginLoaderException(String message) {
30 | super(message);
31 | }
32 |
33 | public PluginLoaderException(String message, Throwable cause) {
34 | super(message, cause);
35 | }
36 |
37 | public PluginLoaderException(Throwable cause) {
38 | super(cause);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/spi/Lazy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.8
28 | */
29 | @Documented
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target({ ElementType.TYPE })
32 | public @interface Lazy {
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/spi/Level.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.9
28 | */
29 | @Documented
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target({ ElementType.TYPE })
32 | public @interface Level {
33 |
34 | /**
35 | *
36 | * @return 级别,值越小,越早加载
37 | */
38 | int value() default 0;
39 | }
40 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/spi/Order.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.8
28 | */
29 | @Documented
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target({ ElementType.TYPE })
32 | public @interface Order {
33 |
34 | /**
35 | *
36 | * @return 排序值,值越小越靠前,值越大越靠后
37 | */
38 | int value() default 0;
39 | }
40 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/spi/SPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.8
28 | * @deprecated
29 | */
30 | @Deprecated
31 | @Documented
32 | @Retention(RetentionPolicy.RUNTIME)
33 | @Target({ ElementType.TYPE })
34 | public @interface SPI {
35 |
36 | String[] value() default {};
37 | }
38 |
--------------------------------------------------------------------------------
/nano-core/src/main/java/org/nanoframework/core/spi/SPIException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.8
22 | */
23 | public class SPIException extends RuntimeException {
24 | private static final long serialVersionUID = 2314941568526812529L;
25 |
26 | public SPIException(final String message) {
27 | super(message);
28 | }
29 |
30 | public SPIException(final String message, final Throwable cause) {
31 | super(message, cause);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/main/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/main/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-core/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module:
--------------------------------------------------------------------------------
1 | org.nanoframework.core.plugins.defaults.module.FieldInjectModule
2 | org.nanoframework.core.plugins.defaults.module.AOPModule
3 | org.nanoframework.core.plugins.defaults.module.APIModule
4 | org.nanoframework.core.plugins.defaults.module.SysAttrModule
5 |
--------------------------------------------------------------------------------
/nano-core/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin:
--------------------------------------------------------------------------------
1 | org.nanoframework.core.plugins.defaults.plugin.Log4j2Plugin
2 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/test/java/org/nanoframework/core/.gitkeep
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/CoreTestSuite.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core;
17 |
18 | import org.nanoframework.core.stereotype.bind.RouteTests;
19 |
20 | import junit.framework.JUnit4TestAdapter;
21 | import junit.framework.Test;
22 | import junit.framework.TestSuite;
23 |
24 | /**
25 | * @author yanghe
26 | * @date 2015年10月8日 下午4:22:35
27 | */
28 | public class CoreTestSuite {
29 | public static Test suite() {
30 | TestSuite suite = new TestSuite("Nano Framework Core Test Suite");
31 | suite.addTest(new JUnit4TestAdapter(RouteTests.class));
32 | return suite;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/Entity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core;
17 |
18 | import org.nanoframework.commons.entity.BaseEntity;
19 | import org.nanoframework.commons.util.UUIDUtils;
20 |
21 | /**
22 | *
23 | * @author yanghe
24 | * @since 1.0
25 | */
26 | public class Entity extends BaseEntity {
27 | private static final long serialVersionUID = 2887355674297694472L;
28 | public final String uuid = UUIDUtils.create();
29 | }
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/EntitySingleton.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core;
17 |
18 | import org.nanoframework.commons.entity.BaseEntity;
19 | import org.nanoframework.commons.util.UUIDUtils;
20 |
21 | import com.google.inject.Singleton;
22 |
23 | /**
24 | *
25 | * @author yanghe
26 | * @since 1.0
27 | */
28 | @Singleton
29 | public class EntitySingleton extends BaseEntity {
30 | private static final long serialVersionUID = 2887355674297694472L;
31 | public final String uuid = UUIDUtils.create();
32 | }
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/component/ApiComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component;
17 |
18 | import org.nanoframework.core.component.impl.ApiComponentImpl;
19 | import org.nanoframework.core.component.stereotype.Component;
20 | import org.nanoframework.core.component.stereotype.bind.RequestMapping;
21 |
22 | import com.google.inject.ImplementedBy;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.2
28 | */
29 | @Component
30 | @ImplementedBy(ApiComponentImpl.class)
31 | public interface ApiComponent {
32 | @RequestMapping("/invoke")
33 | String invoke();
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/component/ApiComponent2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component;
17 |
18 | import org.nanoframework.core.component.impl.ApiComponentImpl;
19 | import org.nanoframework.core.component.stereotype.Component;
20 | import org.nanoframework.core.component.stereotype.bind.RequestMapping;
21 |
22 | import com.google.inject.ImplementedBy;
23 |
24 | /**
25 | *
26 | * @author yanghe
27 | * @since 1.4.2
28 | */
29 | @Component
30 | @ImplementedBy(ApiComponentImpl.class)
31 | public interface ApiComponent2 {
32 | @RequestMapping("/invoke2")
33 | String invoke2();
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/component/aop/AfterAOP.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import org.aopalliance.intercept.MethodInvocation;
19 |
20 | import com.google.inject.Singleton;
21 |
22 | /**
23 | *
24 | * @author yanghe
25 | * @since 1.3.15
26 | */
27 | @Singleton
28 | public class AfterAOP implements IAfter {
29 | public static Object RESULT;
30 |
31 | @Override
32 | public void after(final MethodInvocation invocation, final Object result) {
33 | RESULT = result;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/component/aop/BeforeAOP.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.component.aop;
17 |
18 | import org.aopalliance.intercept.MethodInvocation;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.3.15
24 | */
25 | public class BeforeAOP implements IBefore {
26 | public static Object RESULT;
27 |
28 | @Override
29 | public void before(MethodInvocation invocation) {
30 | RESULT = invocation.getArguments()[0];
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/service/ApiService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.service;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.2
22 | */
23 | public interface ApiService {
24 | String invoke();
25 | }
26 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/service/impl/ApiService2Impl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.service.impl;
17 |
18 | import org.nanoframework.core.inject.API;
19 | import org.nanoframework.core.service.ApiService;
20 |
21 | /**
22 | *
23 | * @author yanghe
24 | * @since 1.4.2
25 | */
26 | @API("apiService2")
27 | public class ApiService2Impl implements ApiService {
28 |
29 | @Override
30 | public String invoke() {
31 | return "Api Invoke 2";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/service/impl/ApiServiceImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.core.service.impl;
17 |
18 | import org.nanoframework.core.inject.API;
19 | import org.nanoframework.core.service.ApiService;
20 |
21 | /**
22 | *
23 | * @author yanghe
24 | * @since 1.4.2
25 | */
26 | @API
27 | public class ApiServiceImpl implements ApiService {
28 |
29 | @Override
30 | public String invoke() {
31 | return "Api Invoke";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/NotSpiService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.8
22 | */
23 | public interface NotSpiService {
24 |
25 | String echo();
26 | }
27 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/SpiLazyService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test;
17 |
18 | import org.nanoframework.core.spi.Lazy;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.4.8
24 | */
25 | @Lazy
26 | public interface SpiLazyService {
27 |
28 | String echo();
29 | }
30 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/SpiNotImplService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.8
22 | */
23 | public interface SpiNotImplService {
24 |
25 | String echo();
26 | }
27 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/SpiService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.8
22 | */
23 | public interface SpiService {
24 |
25 | String echo();
26 | }
27 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestLazyServiceImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test.impl;
17 |
18 | import org.nanoframework.core.spi.test.SpiLazyService;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.4.8
24 | */
25 | public class TestLazyServiceImpl implements SpiLazyService {
26 |
27 | @Override
28 | public String echo() {
29 | return "Echo Lazy TestService";
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestService2Impl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test.impl;
17 |
18 | import org.nanoframework.core.spi.test.SpiService;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.4.8
24 | */
25 | public class TestService2Impl implements SpiService {
26 |
27 | @Override
28 | public String echo() {
29 | return "Echo TestService 2";
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestServiceImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.core.spi.test.impl;
17 |
18 | import org.nanoframework.core.spi.test.SpiService;
19 |
20 | /**
21 | *
22 | * @author yanghe
23 | * @since 1.4.8
24 | */
25 | public class TestServiceImpl implements SpiService {
26 |
27 | @Override
28 | public String echo() {
29 | return "Echo TestService";
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/nano-core/src/test/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/test/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.NotSpiService:
--------------------------------------------------------------------------------
1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl
2 |
--------------------------------------------------------------------------------
/nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiLazyService:
--------------------------------------------------------------------------------
1 | testLazyService=org.nanoframework.core.spi.test.impl.TestLazyServiceImpl
2 | testLazyService2=org.nanoframework.core.spi.test.impl.TestLazyService2Impl
--------------------------------------------------------------------------------
/nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiNotImplService:
--------------------------------------------------------------------------------
1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl
2 |
--------------------------------------------------------------------------------
/nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiService:
--------------------------------------------------------------------------------
1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl
2 | org.nanoframework.core.spi.test.impl.TestService2Impl
3 | testService2
--------------------------------------------------------------------------------
/nano-core/src/test/resources/context.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2015-2016 the original author or authors.
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 | context=
18 |
19 | context.version=0.0.1
20 |
21 | context.mode=DEV
22 |
23 | context.root=/core
24 |
25 | context.component-scan.base-package=org.nanoframework.core.component
26 | context.api-scan.base-package=org.nanoframework.core.component,org.nanoframework.core.service
27 |
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/main/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-dubbo/src/main/resources/.gitkeep
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module:
--------------------------------------------------------------------------------
1 | org.nanoframework.extension.dubbo.DubboReferenceModule
2 | org.nanoframework.extension.dubbo.DubboServiceModule
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/GenericService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.extension.dubbo.service;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.10
22 | */
23 | public interface GenericService {
24 |
25 | T get();
26 | }
27 |
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/HelloWorld2Service.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.extension.dubbo.service;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.1
22 | */
23 | public interface HelloWorld2Service {
24 | String say2(String who);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/HelloWorldService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
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.nanoframework.extension.dubbo.service;
17 |
18 | /**
19 | *
20 | * @author yanghe
21 | * @since 1.4.1
22 | */
23 | public interface HelloWorldService {
24 | String say(String who);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/impl/GenericIntegerService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.extension.dubbo.service.impl;
17 |
18 | import org.nanoframework.extension.dubbo.service.GenericService;
19 |
20 | import com.alibaba.dubbo.config.annotation.Service;
21 |
22 | /**
23 | *
24 | * @author yanghe
25 | * @since 1.4.10
26 | */
27 | @Service(group = "generic.integer")
28 | public class GenericIntegerService implements GenericService {
29 |
30 | @Override
31 | public Integer get() {
32 | return 1;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/impl/GenericMapService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2017 the original author or authors.
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.nanoframework.extension.dubbo.service.impl;
17 |
18 | import java.util.Map;
19 |
20 | import org.nanoframework.commons.util.MapBuilder;
21 | import org.nanoframework.extension.dubbo.service.GenericService;
22 |
23 | import com.alibaba.dubbo.config.annotation.Service;
24 |
25 | /**
26 | *
27 | * @author yanghe
28 | * @since 1.4.10
29 | */
30 | @Service(group = "generic.map")
31 | public class GenericMapService implements GenericService