| org.mmbase.module.ProcessorModule org.mmbase.module.core.MMBase
MMBase | public class MMBase extends ProcessorModule (Code) | | The module which provides access to the MMBase storage defined
by the provided name/setup.
It holds the overal object cloud made up of builders, objects and relations and
all the needed tools to use them.
author: Daniel Ockeloen author: Pierre van Rooden author: Johannes Verelst author: Ernst Bunders version: $Id: MMBase.java,v 1.236 2008/03/11 16:48:02 michiel Exp $ |
Field Summary | |
public String | baseName Base name for the storage to be accessed using this instance of MMBase. | final public static int | startTime Time in seconds, when mmbase was started. |
Constructor Summary | |
public | MMBase(String name) Constructor to create the MMBase root module. |
Method Summary | |
public MMObjectBuilder | addBuilder(String name, MMObjectBuilder bul) | public void | addNodeRelatedEventsListener(String builder, org.mmbase.core.event.EventListener listener) This is a conveniance method to help you register listeners to node and
relation events. | protected void | assertUp() Locks until init of mmbase is finished. | boolean | checkMMBase() Checks whether the storage to be used exists. | protected void | configureOSCache() This method tries to configure the persistence directory of OSCache, if possible (OSCache is
available, and necessary (no 'cache.path' property is configured for OSCache). | boolean | createMMBase() Create a new MMBase persistent storage instance. | public String | getAuthType() | public String | getBaseName() | public MMObjectBuilder | getBuilder(String name) Retrieves a specified builder.
If the builder is not loaded, but the system is in the 'startup' state
(i.e. | public MMObjectBuilder | getBuilderForNode(int number) | public ResourceLoader | getBuilderLoader() | public String | getBuilderNameForNode(int number) | public String | getBuilderPath(String builderName, String path) Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
Return the actual path.
Parameters: builderName - name of the builder to find Parameters: path - the path to start searching. | public BuilderReader | getBuilderReader(String builderName) | public Collection<MMObjectBuilder> | getBuilders() Retrieves a Collection of loaded builders. | public ClusterBuilder | getClusterBuilder() Returns a reference to the cluster builder, a virtual builder used to
perform multilevel searches. | public String | getEncoding() Retrieves the encoding. | public String | getHost() Retrieves the host name or ip number
This value is set using the configuration file. | public InsRel | getInsRel() Returns a reference to the InsRel builder. | public String | getLanguage() Retrieves the current language. | public Locale | getLocale() Retrieves the current locale. | public static MMBase | getMMBase() Retrieves the MMBase module('mmbaseroot'). | public MMBaseCop | getMMBaseCop() Retrieves the loaded security manager(MMBaseCop). | public MMObjectBuilder | getMMObject(String name) Retrieves a specified builder. | public String | getMachineName() Retrieves the machine name. | public OAlias | getOAlias() Returns a reference to the OAlias builder. | public RelDef | getRelDef() Returns a reference to the RelDef builder. | public MMObjectBuilder | getRootBuilder() Returns a reference to the Object builder. | public int | getRootType() Returns the otype of the Object builder, or -1 if it is not known. | public SearchQueryHandler | getSearchQueryHandler() Returns a SearchQueryHandler to access the storage.. | public boolean | getState() Retrieves whether this mmbase module is running. | public StorageManager | getStorageManager() Returns a StorageManager to access the storage.. | public StorageManagerFactory | getStorageManagerFactory() Returns StorageManagerFactory class used to access the storage configuration. | public TimeZone | getTimeZone() Retrieves the timezone asociated with this MMBase's 'DateTime' objects. | public TypeDef | getTypeDef() Returns a reference to the TypeDef builder. | public TypeRel | getTypeRel() Returns a reference to the TypeRel builder. | public boolean | inDevelopment() Returns true when MMBase is in development mode. | public void | init() Initalizes the MMBase module. | public void | initBuilder(MMObjectBuilder builder) | boolean | initBuilders() | protected void | initializeStorage() Loads either the storage manager factory or the appropriate support class using the configuration parameters. | public boolean | isShutdown() | synchronized MMObjectBuilder | loadBuilder(String builderName) Locate one specific builder withing the main builder config path, including sub-paths.
If the builder already exists, the existing object is returned instead.
If the builder cannot be found in this path, a BuilderConfigurationException is thrown.
since: MMBase-1.6 Parameters: builderName - name of the builder to initialize the initialized builder object, or null if the builder could not be created (i.e. | MMObjectBuilder | loadBuilder(String builderName, String ipath) Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
If the builder already exists, the existing object is returned instead.
Parameters: builderName - name of the builder to initialize Parameters: ipath - the path to start searching. | public MMObjectBuilder | loadBuilderFromXML(String builderName, String ipath) Create a new builder object using a xml configfile located in a given path relative to the main builder config path,
and return the builder object.
If the builder already exists, the existing object is returned instead.
Note that the builder's init() method is NOT called (since some builders need other builders in memory when their init() is called,
this method is called seperately after all builders are loaded).
Parameters: builderName - name of the builder to initialize Parameters: ipath - the path to start searching. | public void | maintainance() Performs periodic maintenance. | public void | removeNodeRelatedEventsListener(String builder, org.mmbase.core.event.EventListener listener) | public void | shutdown() | public void | unloadBuilder(MMObjectBuilder builder) Unloads a builders from MMBase. |
baseName | public String baseName(Code) | | Base name for the storage to be accessed using this instance of MMBase.
Retrieved from the mmbaseroot module configuration.
If not specified the default is "def1".
Should be made private and accessed instead using getBaseName()
|
startTime | final public static int startTime(Code) | | Time in seconds, when mmbase was started.
since: MMBase-1.7 |
MMBase | public MMBase(String name)(Code) | | Constructor to create the MMBase root module.
|
addNodeRelatedEventsListener | public void addNodeRelatedEventsListener(String builder, org.mmbase.core.event.EventListener listener)(Code) | | This is a conveniance method to help you register listeners to node and
relation events. Becouse they are now separate listeners the method accepts
an object that may have implemented either NodeEvent
or RelationEvent. This method checks and registers accordingly.
the purpose of this method is that a straight node or relation event listeren
will listen to any node or relation event. This method will wrap your event
listener to make shure only the requested event types are forwarded.
See Also: TypedRelationEventListenerWrapper See Also: TypedNodeEventListenerWrapper See Also: NodeEventListener See Also: RelationEventListener Parameters: builder - should be a valid builder name, the type for which you want toreceive events Parameters: listener - some object implementing NodeEventListener, RelationEventListener,or both since: MMBase-1.8 |
assertUp | protected void assertUp()(Code) | | Locks until init of mmbase is finished.
since: MMBase-1.7 |
checkMMBase | boolean checkMMBase()(Code) | | Checks whether the storage to be used exists.
The system determines whether the object table exists
for the baseName provided in the configuration file.
true if the storage exists and is accessible, false otherwise. |
configureOSCache | protected void configureOSCache()(Code) | | This method tries to configure the persistence directory of OSCache, if possible (OSCache is
available, and necessary (no 'cache.path' property is configured for OSCache). Then, a
directory named 'oscache' in the mmbase data directory is used to set the 'cache.path'
property of the ServletCacheAdminidstrator class of OSCache.
since: MMBase-1.9 |
createMMBase | boolean createMMBase()(Code) | | Create a new MMBase persistent storage instance.
The storage instance created is based on the baseName provided in the configuration file.
This call automatically creates an object table.
The fields in the table are either specified in an object builder xml,
or from a default setup existing of a number field and a owner field.
Note: If specified, the object builder is instantiated and its table created, but
the builder is not registered in the TypeDef builder, as this builder does not exist yet.
Registration happens when the other builders are registered.
true if the storage was succesfully created, otherwise a runtime exception is thrown(shouldn't it return false instead?) |
getBaseName | public String getBaseName()(Code) | | Retrieves the storage base name
the base name as a String |
getBuilder | public MMObjectBuilder getBuilder(String name) throws CircularReferenceException(Code) | | Retrieves a specified builder.
If the builder is not loaded, but the system is in the 'startup' state
(i.e. it is in the process of loading builders), an attempt is made to
directly load the builder.
This allows for dependencies between builders to exist (i.e. inheritance).
When circular reference occurs between two loading buidlers, an exception is thrown.
since: MMBase-1.6 Parameters: name - The name of the builder to retrieve a MMObjectBuilder for the specified builder throws: CircularReferenceException - when circular reference is detected throws: BuilderConfigurationException - if the builder config file does not exist |
getBuilderLoader | public ResourceLoader getBuilderLoader()(Code) | | The (base)path to the builder configuration files
since: MMBase-1.8 |
getBuilderNameForNode | public String getBuilderNameForNode(int number)(Code) | | |
getBuilderPath | public String getBuilderPath(String builderName, String path)(Code) | | Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
Return the actual path.
Parameters: builderName - name of the builder to find Parameters: path - the path to start searching. The path need be closed with a '/ character the file path to the builder xml, or null if the builder could not be created (i.e. is inactive). throws: BuilderConfigurationException - if the builder config file does not exist |
getClusterBuilder | public ClusterBuilder getClusterBuilder()(Code) | | Returns a reference to the cluster builder, a virtual builder used to
perform multilevel searches.
The cluster builder. See Also: ClusterBuilder |
getEncoding | public String getEncoding()(Code) | | Retrieves the encoding.
This value is set using the configuration file.
Examples are 'UTF-8' (default) or 'ISO-8859-1'.
the coding as a String since: MMBase-1.6 |
getHost | public String getHost()(Code) | | Retrieves the host name or ip number
This value is set using the configuration file.
the host name as a String |
getInsRel | public InsRel getInsRel()(Code) | | Returns a reference to the InsRel builder.
the InsRel builder if defined, null otherwise |
getLanguage | public String getLanguage()(Code) | | Retrieves the current language.
This value is set using the configuration file.
Examples are 'en' or 'nl'.
the language as a String |
getLocale | public Locale getLocale()(Code) | | Retrieves the current locale.
since: MMBase-1.8 |
getMMBase | public static MMBase getMMBase()(Code) | | Retrieves the MMBase module('mmbaseroot').
the active MMBase module |
getMMBaseCop | public MMBaseCop getMMBaseCop()(Code) | | Retrieves the loaded security manager(MMBaseCop).
the loaded security manager(MMBaseCop) |
getMMObject | public MMObjectBuilder getMMObject(String name)(Code) | | Retrieves a specified builder.
Parameters: name - The name of the builder to retrieve a MMObjectBuilder if found, null otherwise |
getMachineName | public String getMachineName()(Code) | | Retrieves the machine name.
This value is set using the configuration file.
the machine name as a String |
getOAlias | public OAlias getOAlias()(Code) | | Returns a reference to the OAlias builder.
the OAlias builder if defined, null otherwise |
getRelDef | public RelDef getRelDef()(Code) | | Returns a reference to the RelDef builder.
the RelDef builder if defined, null otherwise |
getRootBuilder | public MMObjectBuilder getRootBuilder()(Code) | | Returns a reference to the Object builder.
The Object builder is the builder from which all other builders eventually extend.
the Object builder. since: MMBase-1.6 |
getRootType | public int getRootType()(Code) | | Returns the otype of the Object builder, or -1 if it is not known.
The Object builder is the builder from which all other builders eventually extend.
since: MMBase-1.6 |
getSearchQueryHandler | public SearchQueryHandler getSearchQueryHandler() throws StorageException(Code) | | Returns a SearchQueryHandler to access the storage.. Equal to getStorageManagerFactory().getSearchQueryHandler().
since: MMBase-1.8 a StorageManager class throws: StorageException - if no storage manager could be instantiated |
getState | public boolean getState()(Code) | | Retrieves whether this mmbase module is running.
true if the module has been initialized and all builders loaded, false otherwise. |
getStorageManager | public StorageManager getStorageManager() throws StorageException(Code) | | Returns a StorageManager to access the storage.. Equal to getStorageManagerFactory().getStorageManager().
since: MMBase-1.7 a StorageManager class throws: StorageException - if no storage manager could be instantiated |
getStorageManagerFactory | public StorageManagerFactory getStorageManagerFactory()(Code) | | Returns StorageManagerFactory class used to access the storage configuration.
since: MMBase-1.7 a StorageManagerFactory class, or null if not configured |
getTimeZone | public TimeZone getTimeZone()(Code) | | Retrieves the timezone asociated with this MMBase's 'DateTime' objects. MMBase stores dates
in storage as 'Date' but without time-zone information, and therefore to a certain
degree open to interpretation.
Together with this timezone the times can be defined absoletely (that is, of course, relative
to the time frame of out planet).
(
since: MMBase-1.8 |
getTypeDef | public TypeDef getTypeDef()(Code) | | Returns a reference to the TypeDef builder.
the TypeDef builder if defined, null otherwise |
getTypeRel | public TypeRel getTypeRel()(Code) | | Returns a reference to the TypeRel builder.
the TypeRel builder if defined, null otherwise |
inDevelopment | public boolean inDevelopment()(Code) | | Returns true when MMBase is in development mode.
This can be used to determine behavior with regards to common errors,
such as whether or not to throw an exception when a non-existing field
in a buidler is referenced.
The value for this property ('true' or 'false') can be set in the "development"
property in the mmbaseroot.xml configuration file.
The default value is false .
since: MMBase-1.8.1 |
init | public void init()(Code) | | Initalizes the MMBase module. Evaluates the parameters loaded from the configuration file.
Sets parameters (authorisation, language), loads the builders, and starts MultiCasting.
|
initBuilder | public void initBuilder(MMObjectBuilder builder)(Code) | | inits a builder
Parameters: builder - The builder which has to be initialized |
initBuilders | boolean initBuilders()(Code) | | Initializes the builders, using the builder xml files in the config directory
Always true |
initializeStorage | protected void initializeStorage()(Code) | | Loads either the storage manager factory or the appropriate support class using the configuration parameters.
since: MMBase-1.7 |
isShutdown | public boolean isShutdown()(Code) | | since: MMBase-1.7 |
loadBuilder | synchronized MMObjectBuilder loadBuilder(String builderName)(Code) | | Locate one specific builder withing the main builder config path, including sub-paths.
If the builder already exists, the existing object is returned instead.
If the builder cannot be found in this path, a BuilderConfigurationException is thrown.
since: MMBase-1.6 Parameters: builderName - name of the builder to initialize the initialized builder object, or null if the builder could not be created (i.e. is inactive). throws: BuilderConfigurationException - if the builder config file does not exist |
loadBuilder | MMObjectBuilder loadBuilder(String builderName, String ipath)(Code) | | Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
If the builder already exists, the existing object is returned instead.
Parameters: builderName - name of the builder to initialize Parameters: ipath - the path to start searching. The path need be closed with a File.seperator character. the initialized builder object, or null if the builder could not be created (i.e. is inactive). throws: BuilderConfigurationException - if the builder config file does not exist |
loadBuilderFromXML | public MMObjectBuilder loadBuilderFromXML(String builderName, String ipath)(Code) | | Create a new builder object using a xml configfile located in a given path relative to the main builder config path,
and return the builder object.
If the builder already exists, the existing object is returned instead.
Note that the builder's init() method is NOT called (since some builders need other builders in memory when their init() is called,
this method is called seperately after all builders are loaded).
Parameters: builderName - name of the builder to initialize Parameters: ipath - the path to start searching. The path need be closed with a '/' character. the loaded builder object. |
maintainance | public void maintainance()(Code) | | Performs periodic maintenance.
|
shutdown | public void shutdown()(Code) | | |
unloadBuilder | public void unloadBuilder(MMObjectBuilder builder)(Code) | | Unloads a builders from MMBase. After this, the builder is gone
Parameters: builder - the builder which has to be unloaded |
Methods inherited from org.mmbase.module.ProcessorModule | public boolean cacheCheck(PageInfo sp, String cmd)(Code)(Java Doc) public Vector<String> getList(PageInfo sp, StringTagger params, String command)(Code)(Java Doc) public MMObjectBuilder getListBuilder(String command, Map<String, Object> params)(Code)(Java Doc) public Vector<MMObjectNode> getNodeList(Object context, String command, Map<String, Object> params)(Code)(Java Doc) public void init()(Code)(Java Doc) public void onload()(Code)(Java Doc) public boolean process(PageInfo sp, Hashtable<String, Object> cmds, Hashtable<String, Object> vars)(Code)(Java Doc) public void reload()(Code)(Java Doc) public String replace(PageInfo sp, String command)(Code)(Java Doc) public String replace(PageInfo sp, StringTagger command)(Code)(Java Doc) public void unload()(Code)(Java Doc)
|
|
|