Skip to content

Commit 10fa312

Browse files
committed
Merge pull request #1 from redcreen/test
interface
2 parents e2db83f + c17d047 commit 10fa312

File tree

161 files changed

+9780
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+9780
-0
lines changed

COPYRIGHT

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright 2011 Alibaba.com All right reserved. This software is the
3+
* confidential and proprietary information of Alibaba.com ("Confidential
4+
* Information"). You shall not disclose such Confidential Information and shall
5+
* use it only in accordance with the terms of the license agreement you entered
6+
* into with Alibaba.com.
7+
*/

README

Whitespace-only changes.

pom.xml

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.redcreen</groupId>
5+
<artifactId>rpcplus</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<name>Rpcplus POM</name>
9+
<description>The project of rpcplus</description>
10+
<properties>
11+
<!-- Common libs -->
12+
<javassist_version>3.15.0-GA</javassist_version>
13+
<netty_version>3.2.5.Final</netty_version>
14+
15+
<java_source_version>1.6</java_source_version>
16+
<java_target_version>1.6</java_target_version>
17+
<file_encoding>UTF-8</file_encoding>
18+
<maven_source_plugin_version>2.1.1</maven_source_plugin_version>
19+
<maven_jar_plugin_version>2.3.2</maven_jar_plugin_version>
20+
<maven_war_plugin_version>2.1.1</maven_war_plugin_version>
21+
<maven_install_plugin_version>2.3.1</maven_install_plugin_version>
22+
<maven_deploy_plugin_version>2.7</maven_deploy_plugin_version>
23+
<maven_compiler_plugin_version>2.3.2</maven_compiler_plugin_version>
24+
<!-- Build args -->
25+
<argline>-Xms512m -Xmx512m</argline>
26+
27+
<!-- Log libs -->
28+
<log4j_version>1.2.16</log4j_version>
29+
<slf4j_version>1.6.2</slf4j_version>
30+
<!-- Test libs -->
31+
<junit_version>4.10</junit_version>
32+
<easymock_version>3.0</easymock_version>
33+
34+
</properties>
35+
<dependencyManagement>
36+
<dependencies>
37+
<dependency>
38+
<groupId>log4j</groupId>
39+
<artifactId>log4j</artifactId>
40+
<version>${log4j_version}</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>junit</groupId>
44+
<artifactId>junit</artifactId>
45+
<version>${junit_version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.easymock</groupId>
49+
<artifactId>easymock</artifactId>
50+
<version>${easymock_version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.easymock</groupId>
54+
<artifactId>easymockclassextension</artifactId>
55+
<version>${easymock_version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.javassist</groupId>
59+
<artifactId>javassist</artifactId>
60+
<version>${javassist_version}</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.jboss.netty</groupId>
64+
<artifactId>netty</artifactId>
65+
<version>${netty_version}</version>
66+
</dependency>
67+
</dependencies>
68+
</dependencyManagement>
69+
<dependencies>
70+
<dependency>
71+
<groupId>log4j</groupId>
72+
<artifactId>log4j</artifactId>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>junit</groupId>
77+
<artifactId>junit</artifactId>
78+
<scope>test</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.easymock</groupId>
82+
<artifactId>easymock</artifactId>
83+
<scope>test</scope>
84+
</dependency>
85+
<dependency>
86+
<groupId>org.easymock</groupId>
87+
<artifactId>easymockclassextension</artifactId>
88+
<scope>test</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>log4j</groupId>
92+
<artifactId>log4j</artifactId>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.javassist</groupId>
96+
<artifactId>javassist</artifactId>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.jboss.netty</groupId>
100+
<artifactId>netty</artifactId>
101+
</dependency>
102+
</dependencies>
103+
<repositories>
104+
105+
</repositories>
106+
<pluginRepositories>
107+
<pluginRepository>
108+
<id>central.repo</id>
109+
<name>Maven Plugin Repository</name>
110+
<url>http://repo1.maven.org/maven2</url>
111+
<layout>default</layout>
112+
<snapshots>
113+
<enabled>false</enabled>
114+
</snapshots>
115+
<releases>
116+
<updatePolicy>never</updatePolicy>
117+
</releases>
118+
</pluginRepository>
119+
</pluginRepositories>
120+
<build>
121+
<plugins>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-source-plugin</artifactId>
125+
<version>${maven_source_plugin_version}</version>
126+
<executions>
127+
<execution>
128+
<id>attach-sources</id>
129+
<goals>
130+
<goal>jar-no-fork</goal>
131+
</goals>
132+
</execution>
133+
</executions>
134+
<configuration>
135+
<attach>true</attach>
136+
</configuration>
137+
</plugin>
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-jar-plugin</artifactId>
141+
<configuration>
142+
<archive>
143+
<addMavenDescriptor>true</addMavenDescriptor>
144+
<index>true</index>
145+
<manifest>
146+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
147+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
148+
</manifest>
149+
<manifestEntries>
150+
<Implementation-Build>${timestamp}</Implementation-Build>
151+
</manifestEntries>
152+
</archive>
153+
</configuration>
154+
</plugin>
155+
</plugins>
156+
<pluginManagement>
157+
158+
<plugins>
159+
160+
<plugin>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-jar-plugin</artifactId>
163+
<version>${maven_jar_plugin_version}</version>
164+
</plugin>
165+
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-war-plugin</artifactId>
169+
<version>${maven_war_plugin_version}</version>
170+
</plugin>
171+
172+
<plugin>
173+
<groupId>org.apache.maven.plugins</groupId>
174+
<artifactId>maven-install-plugin</artifactId>
175+
<version>${maven_install_plugin_version}</version>
176+
</plugin>
177+
178+
<plugin>
179+
<groupId>org.apache.maven.plugins</groupId>
180+
<artifactId>maven-deploy-plugin</artifactId>
181+
<version>${maven_deploy_plugin_version}</version>
182+
</plugin>
183+
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-compiler-plugin</artifactId>
187+
<version>${maven_compiler_plugin_version}</version>
188+
<configuration>
189+
<source>${java_source_version}</source>
190+
<target>${java_target_version}</target>
191+
<encoding>${file_encoding}</encoding>
192+
</configuration>
193+
</plugin>
194+
195+
</plugins>
196+
197+
</pluginManagement>
198+
</build>
199+
<developers>
200+
<developer>
201+
<name>LiuChao(Charles)</name>
202+
<id>chao.liuc</id>
203+
<email>redcreen (AT) redcreen.com</email>
204+
<roles>
205+
<role>Owner</role>
206+
</roles>
207+
<timezone>+8</timezone>
208+
</developer>
209+
210+
</developers>
211+
</project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2011 Alibaba.com All right reserved. This software is the
3+
* confidential and proprietary information of Alibaba.com ("Confidential
4+
* Information"). You shall not disclose such Confidential Information and shall
5+
* use it only in accordance with the terms of the license agreement you entered
6+
* into with Alibaba.com.
7+
*/
8+
package com.redcreen.rpcplus;
9+
10+
import com.redcreen.rpcplus.Annotations.API;
11+
12+
/**
13+
*/
14+
@API
15+
public final class Annotations {
16+
17+
public static @interface Singleton {
18+
};
19+
20+
public static @interface Prototype {
21+
};
22+
23+
/**
24+
* for document
25+
*/
26+
public static @interface SPI {
27+
}
28+
29+
/**
30+
* for document
31+
*/
32+
public static @interface API {
33+
}
34+
35+
/**
36+
* for document
37+
*/
38+
public static @interface ThreadSafe {
39+
};
40+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 1999-2011 Alibaba Group.
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 com.redcreen.rpcplus;
17+
18+
import com.redcreen.rpcplus.Annotations.SPI;
19+
import com.redcreen.rpcplus.Annotations.Singleton;
20+
import com.redcreen.rpcplus.Annotations.ThreadSafe;
21+
22+
23+
/**
24+
* Filter.
25+
*
26+
*/
27+
@SPI
28+
@Singleton
29+
@ThreadSafe
30+
public interface Filter {
31+
32+
/**
33+
* do invoke filter.
34+
*
35+
* <code>
36+
* return invoker.invoke(invocation);
37+
* </code>
38+
*
39+
* @param invoker service
40+
* @param invocation invocation.
41+
* @return invoke result.
42+
* @throws RpcException
43+
*/
44+
Result invoke(Invoker<?> invoker, Invocation invocation) throws InvokeException;
45+
46+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 1999-2011 Alibaba Group.
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 com.redcreen.rpcplus;
17+
18+
import java.util.Map;
19+
20+
import com.redcreen.rpcplus.Annotations.API;
21+
import com.redcreen.rpcplus.Annotations.Prototype;
22+
import com.redcreen.rpcplus.Annotations.ThreadSafe;
23+
24+
/**
25+
* Rpc invocation.
26+
*/
27+
28+
@API
29+
@Prototype
30+
@ThreadSafe
31+
public interface Invocation {
32+
33+
/**
34+
* get method name.
35+
*
36+
* @return method name.
37+
*/
38+
String getMethodName();
39+
40+
/**
41+
* get parameter types.
42+
*
43+
* @return parameter types.
44+
*/
45+
Class<?>[] getParameterTypes();
46+
47+
/**
48+
* get arguments.
49+
*
50+
* @return arguments.
51+
*/
52+
Object[] getArguments();
53+
54+
/**
55+
* get attachments.
56+
*
57+
* @return attachments.
58+
*/
59+
Map<String, String> getAttachments();
60+
61+
}

0 commit comments

Comments
 (0)