no.sesat.search.datamodel
Class DataModelFactory

java.lang.Object
  extended by no.sesat.search.datamodel.DataModelFactory
All Implemented Interfaces:
SiteKeyedFactory

public abstract class DataModelFactory
extends Object
implements SiteKeyedFactory

Base definition of a factory used to create a datamodel, its datanodes, and its dataobjects. Also provides the SiteKeyedFactory implementation, via static methods, to store the current instances in the jvm per site. Each site defines the final DataModelFactory implementation through the "sesam.datamodel.impl" property in its configuration.properties.

Version:
$Id: DataModelFactory.java 7225 2009-04-09 00:32:20Z ssmiweve $

Nested Class Summary
static interface DataModelFactory.Context
          The context any DataModelFactory must work within.
 
Constructor Summary
protected DataModelFactory(DataModelFactory.Context cxt)
          Creates a new instance of DataModelToolkitFactory
 
Method Summary
abstract  DataModel assignControlLevel(DataModel datamodel, ControlLevel controlLevel)
          Lets the datamodel instance know that it has moved on and is now being accessed by a different level in the control process stack.
abstract  ControlLevel currentControlLevel(DataModel datamodel)
          What is the current ControlLevel for the given datamodel.
static DataModelFactory instanceOf(DataModelFactory.Context cxt)
          Instance applicable to the provided context.
abstract  DataModel instantiate()
           
abstract
<T> T
instantiate(Class<T> cls, DataModel datamodel, DataObject.Property... properties)
           Example usage: DataModelFactory dm = DataModelFactory.instanceOf(null); BrowserDataObject bdo = dm.instantiate( BrowserDataObject.class, datamodel, new DataObject.Property("locale", null), new DataObject.Property("supportedLocales", null));
 boolean remove(Site site)
          Remove the factory the maps to the given site.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataModelFactory

protected DataModelFactory(DataModelFactory.Context cxt)
Creates a new instance of DataModelToolkitFactory

Parameters:
cxt -
Method Detail

instanceOf

public static DataModelFactory instanceOf(DataModelFactory.Context cxt)
                                   throws SiteKeyedFactoryInstantiationException
Instance applicable to the provided context.

Parameters:
cxt -
Returns:
Throws:
SiteKeyedFactoryInstantiationException

remove

public boolean remove(Site site)
Description copied from interface: SiteKeyedFactory
Remove the factory the maps to the given site. *

Specified by:
remove in interface SiteKeyedFactory
Parameters:
site - remove factory corresponding to this site.
Returns:
true if a factory was successfully removed.

instantiate

public abstract DataModel instantiate()
Returns:

instantiate

public abstract <T> T instantiate(Class<T> cls,
                                  DataModel datamodel,
                                  DataObject.Property... properties)
 Example usage:
     DataModelFactory dm = DataModelFactory.instanceOf(null);
     BrowserDataObject bdo = dm.instantiate(
       BrowserDataObject.class,
       datamodel,
       new DataObject.Property("locale", null),
       new DataObject.Property("supportedLocales", null));
 

Parameters:
cls -
datamodel -
properties -
Returns:

assignControlLevel

public abstract DataModel assignControlLevel(DataModel datamodel,
                                             ControlLevel controlLevel)
Lets the datamodel instance know that it has moved on and is now being accessed by a different level in the control process stack. This method is only to be used by SESAT classes, not skin implementations! Future version must impose this restriction.

Parameters:
datamodel -
controlLevel -
Returns:

currentControlLevel

public abstract ControlLevel currentControlLevel(DataModel datamodel)
What is the current ControlLevel for the given datamodel. This method is only to be used by SESAT classes, not skin implementations! Future version must impose this restriction.

Parameters:
datamodel - related datamodel we are looking for its control level
Returns:
the current control level


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.