예제 #1
0
 public void acceptOrder(Order order, Warehouse warehouse) {
   CookWholeOrder cookingOrder =
       new CookWholeOrder(order, warehouse, this); // Creating the Callable.
   raisePressure(order.getDifficultyRating());
   _futureOrders.add(
       _superExecutor.submit(
           cookingOrder)); // Submitting the Callable, and adding the future object to the vector.
   // Logger message for accepting new order.
   logger.info("ORDER {} HAS BEEN ACCEPTED", order.getID());
 }
예제 #2
0
 public void releaseOrder(Order order) { // Release the order back to the management.
   _management.getOrder(order);
   decreasePressure(order.getDifficultyRating());
   // Logger message for completing an order.
   logger.info(" ORDER {} IS COMPLETED", order.getID());
 }
예제 #3
0
 public boolean possibleToAcceptOrder(
     Order order) { // Check if it is possible to accept the Order.
   return order.getDifficultyRating() <= _enduranceRating - _currentPressure;
 }