Großmarkt

market
Class SSListenable

java.lang.Object
  |
  +--data.AbstractNameable
        |
        +--data.ooimpl.StockItemImpl
              |
              +--data.ooimpl.StockImpl
                    |
                    +--data.ooimpl.StoringStockImpl
                          |
                          +--market.SSListenable
All Implemented Interfaces:
Cloneable, Comparable, DataBasketEntryDestination, DataBasketEntrySource, DataBasketKeys, ListenableStock, Nameable, NameContext, SelfManagingDBEDestination, SelfManagingDBESource, Serializable, Stock, StockItem, StoringStock

public class SSListenable
extends StoringStockImpl

A StoringStock that can be used as a queue for tills and warehouse, uses SICustomers as StockItems and handles offer-events on it.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class data.ooimpl.StoringStockImpl
m_cclReferentialIntegrityListener, m_nModCount
 
Fields inherited from class data.ooimpl.StockImpl
m_cclEditListener, m_ciCatalog, m_cinlCatalogItemNameListener, m_dbCatalogValidator, m_lhListeners, m_sclEditCreatorListener
 
Fields inherited from class data.AbstractNameable
m_ncContext, m_pcsPropertyListeners
 
Fields inherited from interface data.Nameable
NAME_PROPERTY
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
Constructor Summary
SSListenable(String sName, CatalogImpl ciRef)
           
 
Method Summary
 void add(StockItem si, DataBasket db)
          Adds a StockItem to this Stock, and adds it to the array of listeners, if it`s a SICustomer.
 void addEventListener(OfferEventListener e)
          Adds an OfferEventListener to the array of listeners.
 void commitRemove(DataBasket db, DataBasketEntry dbe)
          Commit the removal of a StockItem, removes it from the array of listeners.
 void fireCountArticles(String articleKey, SProcessWorker spw)
          Fires an event to all listeners: count this article.
 void fireOfferIsEmpty(String articleKey)
          Fires an event to all listeners: this article is empty.
 void fireWakeUpOrders()
          Fires an event to all listeners: a delivery arrived at the market.
 void removeEventListener(OfferEventListener e)
          Removes an OfferEventListener from the array of listeners.
 
Methods inherited from class data.ooimpl.StoringStockImpl
commitAdd, countItems, createPeer, fillShallowClone, get, internalSetCatalog, remove, remove, rollbackAdd, rollbackRemove, setStock
 
Methods inherited from class data.ooimpl.StockImpl
addStock, addStockChangeListener, checkNameChange, clone, compareTo, contains, contains, containsStock, fillStockWithValue, fireCanEditStockItems, fireCanRemoveStockItems, fireEditingStockItems, fireStockItemsAddCommit, fireStockItemsAdded, fireStockItemsAddRollback, fireStockItemsEditCommit, fireStockItemsEditRollback, fireStockItemsRemoveCommit, fireStockItemsRemoved, fireStockItemsRemoveRollback, getCatalog, getEditingItemsContainer, getItemsContainer, getItemsLock, getNCMonitor, getRefIntegrEditContainer, getRefIntegrItemsContainer, getShallowClone, getTemporaryAddedItemsContainer, getTemporaryRemovedItemsContainer, iterator, keySet, nameHasChanged, prepareReferentialIntegrity, removeStockChangeListener, setEditingItemsContainer, setItemsContainer, setRefIntegrEditContainer, setRefIntegrItemsContainer, setTemporaryAddedItemsContainer, setTemporaryRemovedItemsContainer, size, sumStock
 
Methods inherited from class data.ooimpl.StockItemImpl
equals, getAssociatedItem, getStock, toString
 
Methods inherited from class data.AbstractNameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface data.Stock
addStock, contains, contains, containsStock, fillStockWithValue, getCatalog, iterator, keySet, size, sumStock
 
Methods inherited from interface data.StockItem
clone, getAssociatedItem, getStock
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface data.Nameable
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName
 

Constructor Detail

SSListenable

public SSListenable(String sName,
                    CatalogImpl ciRef)
Parameters:
sName - the name of the new Stock.
ciRef - the Catalog that is being referenced by the Stock.
Method Detail

addEventListener

public void addEventListener(OfferEventListener e)
Adds an OfferEventListener to the array of listeners.

Parameters:
e - the OfferEventListener that will be added.

removeEventListener

public void removeEventListener(OfferEventListener e)
Removes an OfferEventListener from the array of listeners.

Parameters:
e - the OfferEventListener that will be removed.

fireOfferIsEmpty

public void fireOfferIsEmpty(String articleKey)
Fires an event to all listeners: this article is empty.

Parameters:
articleKey - the key of the unavaible article.

fireWakeUpOrders

public void fireWakeUpOrders()
Fires an event to all listeners: a delivery arrived at the market.


fireCountArticles

public void fireCountArticles(String articleKey,
                              SProcessWorker spw)
Fires an event to all listeners: count this article.

Parameters:
articleKey - the key of the article to count.
spw - the SProcessWorker which has sended the request.

add

public void add(StockItem si,
                DataBasket db)
Adds a StockItem to this Stock, and adds it to the array of listeners, if it`s a SICustomer.

Specified by:
add in interface Stock
Overrides:
add in class StoringStockImpl
Parameters:
si - the item to be added.
db - the DataBasket relative to which the item will be added.

commitRemove

public void commitRemove(DataBasket db,
                         DataBasketEntry dbe)
Commit the removal of a StockItem, removes it from the array of listeners.

Specified by:
commitRemove in interface SelfManagingDBESource
Overrides:
commitRemove in class StoringStockImpl

Großmarkt