SalesPoint Framework v3.0

sale
Interface ProcessContext

All Known Implementing Classes:
SalesPoint, Shop.ProcessHandle

public interface ProcessContext
extends Serializable

A context that allows processes to run and access certain functionality.

A ProcessContext provides processes with an environment in which they can work. Although some of the functionality could be accessed directly at the Shop, some can't, and for the rest the usage of ProcessContexts provides an extra level of flexibility. It is therefore explicitly recommended that your processes access all of the needed functionality through their context, except in cases where you want to make sure that a special service is carried out at Shop level.

The methods comprising the ProcessContext interface fall into three categories:

  1. Display related methods:
  2. Data and service related methods:
  3. Process management methods: These methods will not be called directly, but rather the Framework will call them as appropriate.

Since:
v2.0
Version:
2.0 27/05/1999
Author:
Steffen Zschaler

Method Summary
 Catalog getCatalog(String sName)
          Get a Catalog by its name.
 User getCurrentUser(SaleProcess p)
          Get the user currently associated with the given process.
 Stock getStock(String sName)
          Get a Stock by its name.
 boolean hasUseableDisplay(SaleProcess p)
          True if the ProcessContext has a useable display for the given process.
 void log(SaleProcess p, Loggable la)
          Put an entry into the ProcessContext's log stream for a process.
 void popUpFormSheet(SaleProcess p, FormSheet fs)
          Pop up a FormSheet for a process.
 void processFinished(SaleProcess p)
          Notification that a process was finished in this ProcessContext.
 void processStarted(SaleProcess p)
          Notification that a process was started in this ProcessContext.
 void setFormSheet(SaleProcess p, FormSheet fs)
          Set a FormSheet for a process.
 void setMenuSheet(SaleProcess p, MenuSheet ms)
          Set a MenuSheet for a process.
 

Method Detail

setFormSheet

public void setFormSheet(SaleProcess p,
                         FormSheet fs)
                  throws InterruptedException
Set a FormSheet for a process.

The FormSheet will be displayed on the ProcessContext's display for the given process, if there is one and it is useable. Setting a null FormSheet will remove any FormSheet currently being displayed.

Override:
Always.
Parameters:
p - the process that wishes to set a FormSheet
fs - the FormSheet that is to be set.
Throws:
InterruptedException - if an interrupt occurred while waiting for the FormSheet to be closed. See Display.setFormSheet for details.
See Also:
Display.setFormSheet(sale.FormSheet)

popUpFormSheet

public void popUpFormSheet(SaleProcess p,
                           FormSheet fs)
                    throws InterruptedException
Pop up a FormSheet for a process.

The FormSheet will be popped up on the ProcessContext's display for the given process, if there is one and it is useable.

Override:
Always.
Parameters:
p - the process that wishes to pop up a FormSheet
fs - the FormSheet that is to be set.
Throws:
InterruptedException - if an interrupt occurred while waiting for the FormSheet to be closed. See Display.popUpFormSheet for details.
See Also:
Display.popUpFormSheet(sale.FormSheet)

setMenuSheet

public void setMenuSheet(SaleProcess p,
                         MenuSheet ms)
Set a MenuSheet for a process.

The MenuSheet will be displayed on the ProcessContext's display for the given process, if there is one and it is useable. Setting a null MenuSheet will remove any MenuSheet currently being displayed.

Override:
Always.
Parameters:
p - the process that wishes to set a MenuSheet
ms - the MenuSheet that is to be set.
See Also:
Display.setMenuSheet(sale.MenuSheet)

hasUseableDisplay

public boolean hasUseableDisplay(SaleProcess p)
True if the ProcessContext has a useable display for the given process.
Override:
Always.
Parameters:
p - the process whose display is to be checked.
See Also:
Display.isUseableDisplay()

log

public void log(SaleProcess p,
                Loggable la)
         throws IOException
Put an entry into the ProcessContext's log stream for a process.
Override:
Always.
Parameters:
p - the process that wishes to put data into the log stream.
la - the information that is to be logged.
Throws:
IOException - if any problems occurred while writing to the log stream.

getCurrentUser

public User getCurrentUser(SaleProcess p)
Get the user currently associated with the given process.
Override:
Always.
Parameters:
p - the process that wishes to know its current user.
Returns:
the current user for the given process.

getStock

public Stock getStock(String sName)
Get a Stock by its name.

The Stock's name is resolved relative to the ProcessContext, so that the same call can result in different Stocks in different ProcessContexts.

Override:
Always.
Parameters:
sName - the name of the Stock to be returned.
Returns:
the Stock that was found for the given name, if any.

getCatalog

public Catalog getCatalog(String sName)
Get a Catalog by its name.

The Catalog's name is resolved relative to the ProcessContext, so that the same call can result in different Catalogs in different ProcessContexts.

Override:
Always.
Parameters:
sName - the name of the Catalog to be returned.
Returns:
the Catalog that was found for the given name, if any.

processStarted

public void processStarted(SaleProcess p)
Notification that a process was started in this ProcessContext.

This method is usually not called directly, but rather the Framework calls it as appropriate.

Override:
Always.
Parameters:
p - the process that was started.

processFinished

public void processFinished(SaleProcess p)
Notification that a process was finished in this ProcessContext.

This method is usually not called directly, but rather the Framework calls it as appropriate.

Override:
Always.
Parameters:
p - the process that was finished.

SalesPoint Framework v3.0