✨
This commit is contained in:
41
Assignment-3/seller2.ol
Normal file
41
Assignment-3/seller2.ol
Normal file
@ -0,0 +1,41 @@
|
||||
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" )()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user