Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle - - PowerPoint PPT Presentation

kotlin ee
SMART_READER_LITE
LIVE PREVIEW

Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle - - PowerPoint PPT Presentation

Kotlin EE Boost Your Productivity Marcus Fihlon @McPringle fun main( args : Array<String>) { val event =


slide-1
SLIDE 1

@McPringle

Marcus Fihlon

Kotlin EE

Boost Your Productivity

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10

fun main(args: Array<String>) { val event = "KotlinConf" println("Hi $event!") }

slide-11
SLIDE 11

class Person(val name: String, val age: Int, val company: String?) { … }

slide-12
SLIDE 12
  • pen class Person(val name: String,

val age: Int, val company: String?) { … }

slide-13
SLIDE 13

data class Person(val name: String, val age: Int, val company: String?) val marcus = Person("Marcus", 29, null) println(marcus) // Person(name=Marcus, age=43, company=null) val marcusCSS = marcus.copy(company = "CSS Insurance") println(marcusCSS) // Person(name=Marcus, age=43, company=CSS Insurance)

slide-14
SLIDE 14
  • bject PersonController {

val persons = mutableListOf<Person>() fun save(person: Person) { persons.add(person) } … }

slide-15
SLIDE 15

fun main(args: Array<String>): Unit = runBlocking { val jobs = List(10) { async(CommonPool) { PriceService().price } } println(jobs.sumBy { it.await() } / 10) }

slide-16
SLIDE 16

val page = html { head { title { "My Website" } } body { p { "Hello KotlinConf!" } } }

slide-17
SLIDE 17
slide-18
SLIDE 18
  • dependencies {

providedCompile "javax:javaee-api:$javaee_version" }

slide-19
SLIDE 19

FROM payara/micro COPY myapplication.war /opt/payara/deployments

slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22

buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" } } allOpen { annotation('javax.ejb.Stateless') annotation('javax.ws.rs.Path') }

slide-23
SLIDE 23

buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version" } } noArg { annotation('javax.ws.rs.Path') }

slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
  • docker-machine ls
  • docker-machine create -d virtualbox mgr
  • docker-machine create -d virtualbox node01
  • docker-machine ssh mgr
  • docker swarm init --advertise-addr 192.168.99.100
slide-27
SLIDE 27
  • docker run -it -d -p 8080:8080 -e HOST=192.168.99.100 \
  • v /var/run/docker.sock:/var/run/docker.sock \
  • -name visualizer dockersamples/visualizer
  • http://192.168.99.100:8080/
slide-28
SLIDE 28
  • docker swarm join-token worker
  • docker-machine ssh node01
  • docker swarm join --token <token> 192.168.99.100:2377
slide-29
SLIDE 29
  • docker-machine ssh mgr
  • docker node ls
  • docker info
slide-30
SLIDE 30
  • docker-machine ssh mgr
  • docker network create -d overlay kotlinconf
  • docker network ls
slide-31
SLIDE 31
  • docker-machine ssh mgr
  • docker service create --network kotlinconf \
  • -name timeservice mcpringle/timeservice
  • docker service create --network kotlinconf -p 8181:8080 \
  • -name helloservice mcpringle/helloservice
  • docker service ls
slide-32
SLIDE 32
  • http http://192.168.99.100:8181/api/hello/kotlinconf
  • docker service update --replicas 3 helloservice
  • docker node update --availability drain mgr
  • docker node update --availability active mgr
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37