これは Kotlin Advent Calendar の26……じゃなくて13日目です!
がんばって読んでください。読まなくても良いですけど。
| ;;; based on the discussion at https://groups.google.com/d/msg/netty/mcGswAZ5NeQ/ivG9snRSFy4J | |
| (ns netty4.core | |
| (:import [io.netty.bootstrap AbstractBootstrap ServerBootstrap] | |
| [io.netty.channel ChannelFuture ChannelInitializer ChannelOption | |
| ChannelHandlerContext ChannelInboundHandlerAdapter ChannelHandler] | |
| [io.netty.handler.logging LogLevel LoggingHandler] | |
| io.netty.buffer.ByteBuf | |
| io.netty.channel.socket.SocketChannel | |
| io.netty.channel.nio.NioEventLoopGroup |
| // lib to add: http://code.google.com/p/google-gson/downloads/detail?name=google-gson-2.2.2-release.zip&can=2&q= | |
| // file Main.scala | |
| package demo | |
| import scala.collection.JavaConverters._ | |
| import com.google.gson.Gson | |
| import java.util.ArrayList | |
| import java.lang.reflect.Type | |
| import com.google.gson.reflect.TypeToken |
これは Kotlin Advent Calendar の26……じゃなくて13日目です!
がんばって読んでください。読まなくても良いですけど。
| /* | |
| * Copyright (C) 2013 Square, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| apply plugin: "osgi" | |
| apply plugin: "java" | |
| apply plugin: "maven" | |
| version = "0.0.1" | |
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } |
| #!/bin/bash | |
| command="$1" | |
| shift | |
| fileSpec="$@" | |
| sentinel=/tmp/t.$$ | |
| touch -t197001010000 $sentinel | |
| while : | |
| do |
| import scala.collection.mutable.ListBuffer | |
| import akka.actor.{Actor,ActorRef} | |
| import akka.actor.Actor._ | |
| import akka.routing.{ Listeners, Listen } | |
| //Represents a domain event | |
| trait Event | |
| //A builder to create domain entities | |
| trait EntityBuilder[Entity] { |