42 lines
1008 B
Plaintext
42 lines
1008 B
Plaintext
from BuyerServiceInterfaceModule import BuyerSellerInterface
|
|
from SellerShipperServiceInterfaceModule import SellerInterface, ShipperInterface
|
|
|
|
include "console.iol"
|
|
|
|
service SellerService {
|
|
execution { concurrent }
|
|
|
|
outputPort Buyer {
|
|
Location: "socket://localhost:9004"
|
|
Protocol: http { format = "json" }
|
|
Interfaces: BuyerSellerInterface
|
|
}
|
|
|
|
outputPort Shipper {
|
|
Location: "socket://localhost:9006"
|
|
Protocol: http { format = "json" }
|
|
Interfaces: ShipperInterface
|
|
}
|
|
|
|
inputPort BuyerSeller {
|
|
location: "socket://localhost:9007"
|
|
protocol: http { format = "json" }
|
|
interfaces: SellerInterface
|
|
}
|
|
|
|
main {
|
|
[ask(product)] {
|
|
println@Console( "Price requested" )()
|
|
quote@Buyer(20)
|
|
}
|
|
[accept(order)] {
|
|
println@Console( "Accepted" )()
|
|
order@Shipper(order)
|
|
}
|
|
[reject(order)] {
|
|
println@Console( "Rejected" )()
|
|
}
|
|
}
|
|
|
|
}
|