public class MMBase extends ProcessorModule
ProcessorModule.GetNodeListFunction, ProcessorModule.ProcessFunction, ProcessorModule.ReplaceFunction| Modifier and Type | Field and Description |
|---|---|
String |
baseName
Base name for the storage to be accessed using this instance of MMBase.
|
(package private) static String |
machineName
Name of the machine used in the mmbase cluster.
|
static int |
startTime
Time in seconds, when mmbase was started.
|
PARAM_PAGEINFO, PARAMS_PAGEINFOconfigurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIMEdescription, guiName, namefunctions, getFunctions| Constructor and Description |
|---|
MMBase(String name)
Constructor to create the MMBase root module.
|
| Modifier and Type | Method and Description |
|---|---|
MMObjectBuilder |
addBuilder(String name,
MMObjectBuilder bul) |
void |
addNodeRelatedEventsListener(String builder,
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.
|
(package private) 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).
|
(package private) boolean |
createMMBase()
Create a new MMBase persistent storage instance.
|
String |
getAuthType() |
String |
getBaseName()
Retrieves the storage base name
|
MMObjectBuilder |
getBuilder(String name)
Retrieves a specified builder.
|
MMObjectBuilder |
getBuilderForNode(int number) |
ResourceLoader |
getBuilderLoader()
The (base)path to the builder configuration files
|
String |
getBuilderNameForNode(int number) |
String |
getBuilderPath(String builderName,
String path)
Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
|
BuilderReader |
getBuilderReader(String builderName) |
Collection<MMObjectBuilder> |
getBuilders()
Retrieves a Collection of loaded builders.
|
ClusterBuilder |
getClusterBuilder()
Returns a reference to the cluster builder, a virtual builder used to
perform multilevel searches.
|
File |
getDataDir()
A setting 'datadir' can be specified in mmbaseroot.xml (and hence in your context xml).
|
DataSource |
getDataSource()
Returns the datasource as was configured with mmbaseroot.xml properties.
|
String |
getEncoding()
Retrieves the encoding.
|
String |
getHost()
Retrieves the host name or ip number
This value is set using the configuration file.
|
InsRel |
getInsRel()
Returns a reference to the InsRel builder.
|
String |
getLanguage()
Retrieves the current language.
|
Locale |
getLocale()
Retrieves the current locale.
|
String |
getMachineName()
Retrieves the machine name.
|
static MMBase |
getMMBase()
Retrieves the MMBase module('mmbaseroot').
|
MMBaseCop |
getMMBaseCop()
Retrieves the loaded security manager(MMBaseCop).
|
MMObjectBuilder |
getMMObject(String name)
Retrieves a specified builder.
|
OAlias |
getOAlias()
Returns a reference to the OAlias builder.
|
RelDef |
getRelDef()
Returns a reference to the RelDef builder.
|
MMObjectBuilder |
getRootBuilder()
Returns a reference to the Object builder.
|
int |
getRootType()
Returns the otype of the Object builder, or -1 if it is not known.
|
SearchQueryHandler |
getSearchQueryHandler()
Returns a SearchQueryHandler to access the storage..
|
boolean |
getState()
Retrieves whether this mmbase module is running.
|
StorageManager<?> |
getStorageManager()
Returns a StorageManager to access the storage..
|
StorageManagerFactory<? extends StorageManager> |
getStorageManagerFactory()
Returns StorageManagerFactory class used to access the storage configuration.
|
TimeZone |
getTimeZone()
Retrieves the timezone asociated with this MMBase's 'DateTime' objects.
|
TypeDef |
getTypeDef()
Returns a reference to the TypeDef builder.
|
TypeRel |
getTypeRel()
Returns a reference to the TypeRel builder.
|
boolean |
inDevelopment()
Returns
true when MMBase is in development mode. |
void |
init()
Initalizes the MMBase module.
|
void |
initBuilder(MMObjectBuilder builder)
inits a builder
|
(package private) boolean |
initBuilders()
Initializes the builders, using the builder xml files in the config directory
|
protected void |
initializeStorage()
Loads either the storage manager factory or the appropriate support class using the configuration parameters.
|
boolean |
isShutdown() |
(package private) MMObjectBuilder |
loadBuilder(String builderName)
Locate one specific builder withing the main builder config path, including sub-paths.
|
(package private) MMObjectBuilder |
loadBuilder(String builderName,
String ipath)
Locate one specific builder within a given path, relative to the main builder config path, including sub-paths.
|
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.
|
void |
removeNodeRelatedEventsListener(String builder,
EventListener listener) |
boolean |
runStartupChecks()
Whether to perform sanity checks during startup.
|
void |
shutdown()
Shuts down the module.
|
void |
unloadBuilder(MMObjectBuilder builder)
Unloads a builders from MMBase.
|
getList, getListBuilder, getNodeList, onload, process, reload, replace, replace, unloadaddInitParameters, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdownModules, startModule, startModulesgetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setNameaddFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstancepublic static final int startTime
public String baseName
static String machineName
public MMBase(String name)
protected void configureOSCache()
public void init()
init in class ProcessorModulepublic void shutdown()
Moduleshutdown in class ModuleModule.shutdown()public boolean isShutdown()
public boolean inDevelopment()
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.boolean checkMMBase()
true if the storage exists and is accessible, false otherwise.boolean createMMBase()
true if the storage was succesfully created, otherwise a runtime exception is thrown
(shouldn't it return false instead?)public MMObjectBuilder getBuilder(String name) throws CircularReferenceException
name - The name of the builder to retrieveMMObjectBuilder for the specified builderCircularReferenceException - when circular reference is detectedBuilderConfigurationException - if the builder config file does not existpublic String getBuilderNameForNode(int number)
public MMObjectBuilder getBuilderForNode(int number)
public MMObjectBuilder addBuilder(String name, MMObjectBuilder bul)
public MMObjectBuilder getMMObject(String name)
name - The name of the builder to retrieveMMObjectBuilder if found, null otherwisepublic static MMBase getMMBase()
public MMBaseCop getMMBaseCop()
public Collection<MMObjectBuilder> getBuilders()
public InsRel getInsRel()
InsRel builder if defined, null otherwisepublic RelDef getRelDef()
RelDef builder if defined, null otherwisepublic TypeDef getTypeDef()
TypeDef builder if defined, null otherwisepublic TypeRel getTypeRel()
TypeRel builder if defined, null otherwisepublic OAlias getOAlias()
OAlias builder if defined, null otherwisepublic MMObjectBuilder getRootBuilder()
Object builder.public int getRootType()
public ClusterBuilder getClusterBuilder()
ClusterBuilderprotected void assertUp()
public String getBaseName()
Stringpublic String getMachineName()
String. Or null if not yet determined.public String getHost()
Stringboolean initBuilders()
truepublic void initBuilder(MMObjectBuilder builder)
builder - The builder which has to be initializedpublic void unloadBuilder(MMObjectBuilder builder)
builder - the builder which has to be unloadedpublic ResourceLoader getBuilderLoader()
public BuilderReader getBuilderReader(String builderName)
MMObjectBuilder loadBuilder(String builderName)
builderName - name of the builder to initializeBuilderConfigurationException - if the builder config file does not existpublic String getBuilderPath(String builderName, String path)
builderName - name of the builder to findpath - the path to start searching. The path need be closed with a '/ characterBuilderConfigurationException - if the builder config file does not existMMObjectBuilder loadBuilder(String builderName, String ipath)
builderName - name of the builder to initializeipath - the path to start searching. The path need be closed with a File.seperator character.BuilderConfigurationException - if the builder config file does not existpublic MMObjectBuilder loadBuilderFromXML(String builderName, String ipath)
builderName - name of the builder to initializeipath - the path to start searching. The path need be closed with a '/' character.protected void initializeStorage()
public StorageManagerFactory<? extends StorageManager> getStorageManagerFactory()
null if not configuredpublic StorageManager<?> getStorageManager() throws StorageException
StorageException - if no storage manager could be instantiatedpublic SearchQueryHandler getSearchQueryHandler() throws StorageException
StorageException - if no storage manager could be instantiatedpublic String getAuthType()
public String getLanguage()
Stringpublic Locale getLocale()
public TimeZone getTimeZone()
public String getEncoding()
Stringpublic boolean getState()
true if the module has been initialized and all builders loaded, false otherwise.public void addNodeRelatedEventsListener(String builder, EventListener listener)
builder - should be a valid builder name, the type for which you want to
receive eventslistener - some object implementing NodeEventListener, RelationEventListener,
or bothTypedRelationEventListenerWrapper,
TypedNodeEventListenerWrapper,
NodeEventListener,
RelationEventListenerpublic void removeNodeRelatedEventsListener(String builder, EventListener listener)
builder - listener - addNodeRelatedEventsListener(java.lang.String, org.mmbase.core.event.EventListener)public File getDataDir()
public DataSource getDataSource()
public boolean runStartupChecks()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}