-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started
bleujin edited this page Apr 15, 2013
·
9 revisions
- Required : JDK 1.6 Higher
- ref Lib : ant, apache-common, iframework, jci, netty, restlet
public class TestAradon {
public static void main(String[] args) throws Exception {
Configuration config = ConfigurationBuilder.newBuilder().aradon()
.sections().restSection("")
.path("hello")
.addUrlPattern("/hello")
.addUrlPattern("/hello/{name}")
.handler(HelloWorldLet.class).build();
// Configuration config = ConfigurationBuilder
// .load(XMLConfig.create("./aradon-config.xml")).build();
Aradon aradon = Aradon.create(config);
aradon.startServer(9000);
}
}
class HelloWorldLet extends AbstractServerResource {
@Get
public String myGet(@PathParam(value = "name") String name) {
return "hello, " + name;
}
}Aradon은 아래와 같은 구조로 되어 있다.[참고 : aradon-config.xml]
<root>
<context />
<prefilter />
<afterfilter />
<section>
<context />
<prefilter />
<afterfilter />
<path>
<context />
<prefilter />
<afterfilter />
<urls />
<handler />
</path>
</section>
</root>Aradon은 한개의 root를 가지며 root는 n개의 Section을 가지며 Section은 n개의 Path를 가진다. http://address:port//[section]/[pathUrl]의 계층형 서비스 방식으로 해석한다.