View Javadoc

1   /*
2    * @(#) ProductionOrderHandler.java Aug 8, 2005
3    * 
4    * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands. All rights reserved.
6    * 
7    * See for project information <a href="http://www.simulation.tudelft.nl/">
8    * www.simulation.tudelft.nl </a>.
9    * 
10   * The source code and binary code of this software are proprietary information
11   * of Delft University of Technology.
12   */
13  package nl.tudelft.simulation.supplychain.handlers;
14  
15  import java.io.Serializable;
16  
17  import nl.tudelft.simulation.supplychain.actor.SupplyChainActor;
18  import nl.tudelft.simulation.supplychain.content.ProductionOrder;
19  import nl.tudelft.simulation.supplychain.production.Production;
20  
21  /***
22   * Handles ProductionOrders.
23   * <p>
24   * (c) copyright 2005 <a href="http://www.simulation.tudelft.nl">Delft
25   * University of Technology </a>, the Netherlands. <br>
26   * See for project information <a
27   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
28   * 
29   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
30   * Delft, the Netherlands. All rights reserved.
31   * 
32   * See for project information <a href="http://www.simulation.tudelft.nl/">
33   * www.simulation.tudelft.nl </a>.
34   * 
35   * The source code and binary code of this software are proprietary information
36   * of Delft University of Technology.
37   * 
38   * @author <a
39   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
40   *         van Houten </a>
41   * @version $Revision: 1.2 $ $Date: 2005/08/10 11:23:17 $
42   * @since 1.0.8
43   */
44  public class ProductionOrderHandler extends SupplyChainHandler
45  {
46  	/*** for debugging */
47  	private static final boolean DEBUG = false;
48  
49  	/*** the production facility of this handler */
50  	private Production production = null;
51  
52  	/***
53  	 * constructs a new ProductionOrderHandler
54  	 * 
55  	 * @param owner the owner of the production order handler
56  	 * @param production the production facility
57  	 */
58  	public ProductionOrderHandler(final SupplyChainActor owner,
59  			final Production production)
60  	{
61  		super(owner);
62  		this.production = production;
63  		if (ProductionOrderHandler.DEBUG)
64  		{
65  			System.out
66  					.println("DEBUG -- ProductionOrderHandler has been created and added to: "
67  							+ owner.getName());
68  		}
69  	}
70  
71  	/***
72  	 * @see nl.tudelft.simulation.supplychain.handlers.SupplyChainHandler#checkContentClass(java.io.Serializable)
73  	 */
74  	protected boolean checkContentClass(final Serializable content)
75  	{
76  		return (content instanceof ProductionOrder);
77  	}
78  
79  	/***
80  	 * @see nl.tudelft.simulation.content.HandlerInterface#handleContent(java.io.Serializable)
81  	 */
82  	public boolean handleContent(final Serializable content)
83  	{
84  		return this.production.acceptProductionOrder((ProductionOrder) content);
85  	}
86  
87  	/***
88  	 * Method getProduction
89  	 * 
90  	 * @return returns the production
91  	 */
92  	public Production getProduction()
93  	{
94  		return this.production;
95  	}
96  }