folge2TMNavTMHarvestPanckoucke
Hamburg 2004

... access Panckoucke

Panckoucke Context

The panckoucke library defines the PanckouckeContext that gives you access to the main features panckoucke offers. This includes access to the ModelProvider, the StoreManager, the Notification-, Representation- and GestaltRegistry and to the available Abstractors and Renderers.

Get the Context

To get the PanckouckeContext you have to instantiate a ContextFactory and call one of the createContext(...)-methods. The methods differ from what resource the context is build of, and allows you to supply your own context definition. If you do not supply a source, the default context description is used.

Example code

   	
  try {
    // instantiate a factory
    ContextFactory f = new ContextFactoryImpl();
    
    // get the default context
    PanckouckeContext ctx =  f.createContext();
    
    // get the main objects, 
    // ... the StoreManager
    StoreManager storeManager = ctx.getStoreManager();
            
    // ... the ModelProvider
    ModelProvider modelProvider = ctx.getModelProvider();
            
    // ... etc.      
    
  }
  catch (ContextException e) {
    throw e; // stop further processing.
  }
  
  

About the exceptions

ContextException

The factory was unable to create the context. This is severe, since all panckoucke functionality relates on the context. The application should stop processing.