fr.gouv.culture.sdx.framework
Class FrameworkImpl

java.lang.Object
  extended byfr.gouv.culture.sdx.framework.FrameworkImpl
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, Framework, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.activity.Suspendable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.cocoon.xml.XMLizable

public class FrameworkImpl
extends java.lang.Object
implements Framework, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.activity.Suspendable, org.apache.avalon.framework.logger.LogEnabled, org.apache.cocoon.xml.XMLizable, org.apache.avalon.framework.thread.ThreadSafe

Core unit of SDX, loads applications, pipelines, etc. TODOJavadoc: better documentation-rbp


Field Summary
static java.lang.String ANALYZER_MGR
          String representation for a key in the Properties object : framework's analyzer manager.
static java.lang.String APP_CONF
          String representation for a key in the Properties object : framework's applications configurations.
static java.lang.String APP_CONF_PATH
          String representation for a key in the Properties object : framework's applications configuration directories.
static java.lang.String APP_CONFIG_FILENAME
          The configuration file name of an application.
static java.lang.String APP_PATH_NAME
          String representation for a key in the Properties object : framework's applications names.
static java.lang.String ATTRIBUTE_NAME_ENCODING
          Attribute name for configuration file/also used as hashtable key
static java.lang.String CONFIGURATION_FILE_NAME
          The framework's configuration filename.
static java.lang.String LIB_PATH
          String representation for a key in the Properties object : framework's libraries.
static java.lang.String RMI_HOST
          String representation for a key in the Properties object : famework's RMI host.
static java.lang.String RMI_PORT
          String representation for a key in the Properties object : famework's RMI port.
static java.lang.String SDX_APP_PATH
          String representation for a key in the Properties object : framework's context directory.
static java.lang.String SDX_CONF
          String representation for a key in the Properties object : framework's configuration file.
static java.lang.String SDX_CONF_PATH
          String representation for a key in the Properties object : framework's configuration directory.
static java.lang.String SDX_DEFAULT_RMI_HOST
          Default RMI host
static int SDX_DEFAULT_RMI_PORT
          Default RMI port
static java.lang.String SECURITY_POLICY
          String representation for a key in the Properties object : security policy.
 
Fields inherited from interface fr.gouv.culture.sdx.framework.Framework
ATTRIBUTE_LANG, BUILD, DEFAULT_ENCODING, ROLE, SDXNamespacePrefix, SDXNamespaceURI, TOSAX, URL_ENCODING, VERSION, XMLNamespacePrefix, XMLNamespaceURI
 
Constructor Summary
FrameworkImpl()
           
 
Method Summary
 void addApplication(java.lang.String appPath)
          Add's an application based upon a path (ie. directory name) containing the application's configuration file, etc.
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Sets the framework ComponentManager.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Configures the framework.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Contextualize this class.
 void dispose()
          Disposes the component, but currently has no function.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Sets the logger for this framework
 Application getApplicationById(java.lang.String id)
          Gets an application identified by its id.
 Application getApplicationByPath(java.lang.String path)
          Gets an application identified by its path.
 java.util.Enumeration getApplicationIds()
          Returns an Enumeration on the ids of the applications owned by this framework.
 java.lang.String getEncoding()
           
 java.util.Locale getLocale()
          Returns the locale for the framework
 org.apache.avalon.framework.logger.Logger getLogger()
          Gets the framework's logger.
 Pipeline getPipeline(java.lang.String id)
          Returns a new instance of the desired pipeline.
 java.lang.String getXmlLang()
          Returns the xml:lang attibute value from the configuration
 boolean hasComponent(java.lang.Object hint)
          Check to see if a Component exists for a hint, but currently has no function and only returns false.
 void initialize()
          Initializes the framework and builds the necessary application, pipeline, and analyzer manager objects.
 boolean isSuperUserSet()
          Indicates whether the super user info is set
 void reconfigure(org.apache.avalon.framework.configuration.Configuration conf)
          Reconfigures the component
 void reconfigureApplication(java.lang.String appId)
          Reconfigures and application based upon an id
 void release(org.apache.avalon.framework.component.Component component)
          Releases the Component when we are finished with it.
 void removeApplication(java.lang.String appId)
          Removes and application from the framework based upon an id
 void resume()
          Resumes the component after it has been suspended, but currently has no function.
 org.apache.avalon.framework.component.Component select(java.lang.Object hint)
          Select the Component associated with the given hint, but currently has no function and only returns null.
 void setSuperUser(java.lang.String initialUserId, java.lang.String initialPasswd, java.lang.String newUserId, java.lang.String newPasswd, java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String xmlLang)
          Set's the super user information
 void start()
          Starts the component, but currently has no function.
 void stop()
          Stops the component, but currently has no function.
 void suspend()
          Suspends the component, but currently has no function.
 void toSAX(org.xml.sax.ContentHandler handler)
          Could send an XML representation of something, but currently has no function.
 SuperuserInformation validateSuperUser(java.lang.String userid, java.lang.String passwd)
          Validates the super user based on the provided and password
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_FILE_NAME

public static final java.lang.String CONFIGURATION_FILE_NAME
The framework's configuration filename.

See Also:
Constant Field Values

APP_CONFIG_FILENAME

public static final java.lang.String APP_CONFIG_FILENAME
The configuration file name of an application.

See Also:
Constant Field Values

SDX_CONF

public static final java.lang.String SDX_CONF
String representation for a key in the Properties object : framework's configuration file.

See Also:
Constant Field Values

APP_PATH_NAME

public static final java.lang.String APP_PATH_NAME
String representation for a key in the Properties object : framework's applications names.

See Also:
Constant Field Values

APP_CONF_PATH

public static final java.lang.String APP_CONF_PATH
String representation for a key in the Properties object : framework's applications configuration directories.

See Also:
Constant Field Values

APP_CONF

public static final java.lang.String APP_CONF
String representation for a key in the Properties object : framework's applications configurations.

See Also:
Constant Field Values

SDX_APP_PATH

public static final java.lang.String SDX_APP_PATH
String representation for a key in the Properties object : framework's context directory.

See Also:
Constant Field Values

SDX_CONF_PATH

public static final java.lang.String SDX_CONF_PATH
String representation for a key in the Properties object : framework's configuration directory.

See Also:
Constant Field Values

LIB_PATH

public static final java.lang.String LIB_PATH
String representation for a key in the Properties object : framework's libraries.

See Also:
Constant Field Values

SECURITY_POLICY

public static final java.lang.String SECURITY_POLICY
String representation for a key in the Properties object : security policy.

See Also:
Constant Field Values

RMI_HOST

public static final java.lang.String RMI_HOST
String representation for a key in the Properties object : famework's RMI host.

See Also:
Constant Field Values

RMI_PORT

public static final java.lang.String RMI_PORT
String representation for a key in the Properties object : famework's RMI port.

See Also:
Constant Field Values

ANALYZER_MGR

public static final java.lang.String ANALYZER_MGR
String representation for a key in the Properties object : framework's analyzer manager.

See Also:
Constant Field Values

ATTRIBUTE_NAME_ENCODING

public static final java.lang.String ATTRIBUTE_NAME_ENCODING
Attribute name for configuration file/also used as hashtable key

See Also:
Constant Field Values

SDX_DEFAULT_RMI_HOST

public static final java.lang.String SDX_DEFAULT_RMI_HOST
Default RMI host

See Also:
Constant Field Values

SDX_DEFAULT_RMI_PORT

public static final int SDX_DEFAULT_RMI_PORT
Default RMI port

See Also:
Constant Field Values
Constructor Detail

FrameworkImpl

public FrameworkImpl()
Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the logger for this framework

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Parameters:
logger - The logger.

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Contextualize this class.

Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Parameters:
context - The context provided by Cocoon.
Throws:
org.apache.avalon.framework.context.ContextException

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Sets the framework ComponentManager.

Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Parameters:
manager - The ComponentManager. Provided by Cocoon.
Throws:
org.apache.avalon.framework.component.ComponentException

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configures the framework.

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - The configuration object provided at startup by Cocoon, using the element in cocoon.xconf.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

reconfigure

public void reconfigure(org.apache.avalon.framework.configuration.Configuration conf)
                 throws org.apache.avalon.framework.configuration.ConfigurationException
Reconfigures the component

Specified by:
reconfigure in interface org.apache.avalon.framework.configuration.Reconfigurable
Parameters:
conf - Currently a null value is supported and this calls re-initializes the Framework by calling intialize(), USE WITH CAUTION TODO : please explain -pb
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
initialize()

reconfigureApplication

public void reconfigureApplication(java.lang.String appId)
                            throws SDXException
Reconfigures and application based upon an id

Parameters:
appId - The id of the application to be reconfigured
Throws:
SDXException

initialize

public void initialize()
                throws java.lang.Exception
Initializes the framework and builds the necessary application, pipeline, and analyzer manager objects.

Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

start

public void start()
Starts the component, but currently has no function.

Specified by:
start in interface org.apache.avalon.framework.activity.Startable

suspend

public void suspend()
Suspends the component, but currently has no function.

Specified by:
suspend in interface org.apache.avalon.framework.activity.Suspendable

stop

public void stop()
Stops the component, but currently has no function.

Specified by:
stop in interface org.apache.avalon.framework.activity.Startable

dispose

public void dispose()
Disposes the component, but currently has no function.

Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

resume

public void resume()
Resumes the component after it has been suspended, but currently has no function.

Specified by:
resume in interface org.apache.avalon.framework.activity.Suspendable

hasComponent

public boolean hasComponent(java.lang.Object hint)
Check to see if a Component exists for a hint, but currently has no function and only returns false.

Specified by:
hasComponent in interface org.apache.avalon.framework.component.ComponentSelector

select

public org.apache.avalon.framework.component.Component select(java.lang.Object hint)
                                                       throws org.apache.avalon.framework.component.ComponentException
Select the Component associated with the given hint, but currently has no function and only returns null.

Specified by:
select in interface org.apache.avalon.framework.component.ComponentSelector
Throws:
org.apache.avalon.framework.component.ComponentException

release

public void release(org.apache.avalon.framework.component.Component component)
Releases the Component when we are finished with it.

Specified by:
release in interface org.apache.avalon.framework.component.ComponentSelector

addApplication

public void addApplication(java.lang.String appPath)
                    throws SDXException
Add's an application based upon a path (ie. directory name) containing the application's configuration file, etc.

Parameters:
appPath - The directory name for the application under the sdx installation (example: sdxworld)
Throws:
SDXException

removeApplication

public void removeApplication(java.lang.String appId)
                       throws SDXException
Removes and application from the framework based upon an id

Parameters:
appId -
Throws:
SDXException

getLogger

public org.apache.avalon.framework.logger.Logger getLogger()
Gets the framework's logger.

Returns:
The logger.

getApplicationIds

public java.util.Enumeration getApplicationIds()
Returns an Enumeration on the ids of the applications owned by this framework.


getApplicationById

public Application getApplicationById(java.lang.String id)
                               throws SDXException
Gets an application identified by its id.

Parameters:
id - The application's id.
Returns:
The application object.
Throws:
SDXException

getApplicationByPath

public Application getApplicationByPath(java.lang.String path)
                                 throws SDXException
Gets an application identified by its path.

Parameters:
path - The application's path (the directory name for the application under the sdx installation, i.e. {TOMCAT_HOME}/webapps/{sdx}/{myApp}).
Returns:
The application object.
Throws:
SDXException

getPipeline

public Pipeline getPipeline(java.lang.String id)
                     throws SDXException
Returns a new instance of the desired pipeline.

Parameters:
id - The id of the desired query pipeline
Returns:
Throws:
SDXException

setSuperUser

public void setSuperUser(java.lang.String initialUserId,
                         java.lang.String initialPasswd,
                         java.lang.String newUserId,
                         java.lang.String newPasswd,
                         java.lang.String firstname,
                         java.lang.String lastname,
                         java.lang.String email,
                         java.lang.String xmlLang)
                  throws SDXException
Set's the super user information

Parameters:
initialUserId - The user id, null should be passed at initial set-up.
initialPasswd - The existing super user password , null should be passed at initial set-up.
newUserId - The new user id.
newPasswd - The new password.
firstname - The first name
lastname - The last name
email - The email
xmlLang - A valid xml:lang attribute value
Throws:
SDXException

isSuperUserSet

public boolean isSuperUserSet()
Indicates whether the super user info is set


validateSuperUser

public SuperuserInformation validateSuperUser(java.lang.String userid,
                                              java.lang.String passwd)
                                       throws SDXException
Validates the super user based on the provided and password

Parameters:
userid -
passwd -
Returns:
The SuperuserInformation object
Throws:
SDXException

getXmlLang

public java.lang.String getXmlLang()
Returns the xml:lang attibute value from the configuration


getLocale

public java.util.Locale getLocale()
Returns the locale for the framework


toSAX

public void toSAX(org.xml.sax.ContentHandler handler)
           throws org.xml.sax.SAXException,
                  org.apache.cocoon.ProcessingException
Could send an XML representation of something, but currently has no function.

Specified by:
toSAX in interface org.apache.cocoon.xml.XMLizable
Parameters:
handler - A SAX content handler to feed with events.
Throws:
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

getEncoding

public java.lang.String getEncoding()


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.