SAP NetWeaver '04

com.sap.netweaver.bc.rf.mi
Class AbstractManager

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.mi_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.mi.AbstractManager
All Implemented Interfaces:
IComponent, IComponentInfo, IConfigurable, IContainer, IContextualizable, IEventSender, ILifecycleInfo, IManager, IResourceEventSender, IStartable, IThreadSafe

public abstract class AbstractManager
extends java.lang.Object
implements IManager, IResourceEventSender, IThreadSafe, IContainer, IConfigurable, IStartable, IComponentInfo, ILifecycleInfo

Abstract base class for repository managers.


Field Summary
protected  IConfiguration config
          This manager's configuration
protected  java.lang.String prefix
           
protected  ComponentStateHandler stateHandler
           
 
Constructor Summary
AbstractManager()
          Construct object of class AbstractManager.
 
Method Summary
protected  void checkNotReconfigurableAttributes(java.lang.String[] notReconfigurable, IConfiguration newConfig)
          Helper method for reconfigure() implementations.
 void configure(IConfiguration config)
          Passes the configuration data to the configurable.
 void contextualize(IContext context)
          Pass the context to the component.
 boolean equals(java.lang.Object other)
           
 boolean eventsEnabled()
          Returns true if standard resource events should be sent by the framework.
 IBasicVersioningManager getBasicVersioningManager()
           
 IComponentManager getComponentManager()
          Returns the component manager for accessing this container's child components.
 IConfiguration getConfig()
           
 IContentManager getContentManager()
           
 java.util.Date getCreationDate()
          Returns the date and time of the creation of the component instance.
 java.lang.String getDescription(java.util.Locale locale)
          Returns a description of the components purpose or null .
 IResourceEventBroker getEventBroker()
           
 IEventList getEvents()
          Returns a list of event templates for all possible events of this sender.
 IEventList getEvents(IResource resource)
          This method is used to report all possible events for a resource.
 java.lang.String getId()
          Get the unique id of the repository manager (usually assigned and made unique through the configuration framework).
 ConfigurationException getLastConfigurationException()
          Returns the exception thrown in the last call to IConfigurable.configure(IConfiguration), or IReconfigurable.reconfigure(IConfiguration).
 java.util.Date getLastReconfigurationDate()
          Returns the date and time of the last reconfiguration of this component.
 ILockManager getLockManager()
           
 java.lang.String getName()
          Returns the component's human-readable name or null .
 NameInfo getNameInfo()
          Get the NameInfo of a repository manager.
 INamespaceManager getNamespaceManager()
           
 java.util.Date getNextAutoRestartDate()
          Returns the date and time of the next automatic restart of the component.
 java.util.Properties getProperties()
          Returns some arbitrary properties with information about the component or null .
 IPropertyManager getPropertyManager()
           
 java.lang.String getRidPrefix()
          Get the root token of a resource id, this resource manager claims responsibility for.
 ISecurityManager getSecurityManager()
           
 StartupException getStartupException()
          Returns the exception thrown in the last call to IStartable.start(), Can be null .
 ComponentState getState()
          Returns the current life-cycle state of the component.
 java.util.Map getSubManagers()
          Get map of sub managers indexed by sub manager interface, e.g. a repository manager with a content and property sub manager implemented in one class and a separate security sub manager implemented in another class, returns a map with the content and property sub manager added twice via the content sub manager interface and the property sub manager interface and the security sub manager via the security sub manager interface.
 int hashCode()
           
 boolean mustSendResourceEventType(int type)
          ResourceImpl will call this method to check if a given resource event type must be sent at all.
protected  boolean reconfigureSecurityManager(IConfiguration newConfig)
          Must be called by the RM implementation in its reconfigure() method if reconfiguration of security managers at runtime must be supported.
protected  void registerSecurityManager(java.lang.String name, java.lang.String manager)
           
 IResourceEvent sendEvent(IResource resource, int type, java.lang.String correlationId, java.lang.Object param)
          ResourceImpl will call this method to send the standard resource events
protected  void shutDownImpl()
          The implementation must overwrite this method if it has to release resources acquired during shutdown.
 void start()
          A component must implement this method if it has initial startup handling to do before being accessible (acquire resources, open connections to remote systems, etc).
protected  void startUpImpl()
          The implementation must overwrite this method if it has initial startup handling to do (acquire resources, open connections to remote systems, etc).
 void stop()
          This method is only called once during the life-time of a component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sap.netweaver.bc.rf.mi.IManager
getSupportedOptions, lookup, lookup, lookup
 

Field Detail

stateHandler

protected final ComponentStateHandler stateHandler

config

protected IConfiguration config
This manager's configuration

prefix

protected java.lang.String prefix
Constructor Detail

AbstractManager

public AbstractManager()
Construct object of class AbstractManager.
Method Detail

getConfig

public IConfiguration getConfig()

getSecurityManager

public ISecurityManager getSecurityManager()

getNamespaceManager

public INamespaceManager getNamespaceManager()

getPropertyManager

public IPropertyManager getPropertyManager()

getLockManager

public ILockManager getLockManager()

getBasicVersioningManager

public IBasicVersioningManager getBasicVersioningManager()

getContentManager

public IContentManager getContentManager()

getId

public java.lang.String getId()
Description copied from interface: IManager
Get the unique id of the repository manager (usually assigned and made unique through the configuration framework).
Specified by:
getId in interface IManager
Following copied from interface: com.sap.netweaver.bc.rf.mi.IManager
Returns:
unique id of the repository manager

getRidPrefix

public java.lang.String getRidPrefix()
Description copied from interface: IManager
Get the root token of a resource id, this resource manager claims responsibility for. The framework will call this method to know which repository manager to call when a resource having the matching root token needs to be handled.
Specified by:
getRidPrefix in interface IManager
Following copied from interface: com.sap.netweaver.bc.rf.mi.IManager
Returns:
root token of a resource id, this resource manager claims responsibility for

getNameInfo

public NameInfo getNameInfo()
Description copied from interface: IManager
Get the NameInfo of a repository manager. The NameInfo contains information about the restrictions for resource and collection names.
Specified by:
getNameInfo in interface IManager
Following copied from interface: com.sap.netweaver.bc.rf.mi.IManager
Returns:
information about the restrictions for resource and collection names

getSubManagers

public java.util.Map getSubManagers()
Description copied from interface: IManager
Get map of sub managers indexed by sub manager interface, e.g. a repository manager with a content and property sub manager implemented in one class and a separate security sub manager implemented in another class, returns a map with the content and property sub manager added twice via the content sub manager interface and the property sub manager interface and the security sub manager via the security sub manager interface.
Specified by:
getSubManagers in interface IManager
Following copied from interface: com.sap.netweaver.bc.rf.mi.IManager
Returns:
map of sub managers indexed by sub manager interface

getEventBroker

public IResourceEventBroker getEventBroker()

getState

public final ComponentState getState()
Description copied from interface: ILifecycleInfo
Returns the current life-cycle state of the component. Can be null .
Specified by:
getState in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
the current life-cycle state of the component. Can be null .

getCreationDate

public final java.util.Date getCreationDate()
Description copied from interface: ILifecycleInfo
Returns the date and time of the creation of the component instance. Can be null . This property usually makes sense only for components that implement the IThreadSafe interface.
Specified by:
getCreationDate in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
the date and time of the creation of the component instance. Can be null .

getEvents

public IEventList getEvents()
Description copied from interface: IEventSender
Returns a list of event templates for all possible events of this sender. The event instances contained in the list are "templates", that means the event parameter is not relevant. The broker will call it to build a list of all possible events of all registered event senders.
Specified by:
getEvents in interface IEventSender
Following copied from interface: com.sapportals.wcm.util.events.IEventSender
Returns:
a list of event templates for all possible events of this sender.

getEvents

public IEventList getEvents(IResource resource)
Description copied from interface: IResourceEventSender
This method is used to report all possible events for a resource. The broker will call it to build a list of all possible events of alle registered event senders.
Specified by:
getEvents in interface IResourceEventSender
Following copied from interface: com.sapportals.wcm.repository.manager.IResourceEventSender
Parameters:
resource - The resource
Returns:
events

getComponentManager

public IComponentManager getComponentManager()
Description copied from interface: IContainer
Returns the component manager for accessing this container's child components.
Specified by:
getComponentManager in interface IContainer
Following copied from interface: com.sapportals.wcm.crt.component.IContainer
Returns:
the component manager for accessing this container's child components.

getName

public java.lang.String getName()
Description copied from interface: IComponentInfo
Returns the component's human-readable name or null .
Specified by:
getName in interface IComponentInfo
Following copied from interface: com.sapportals.wcm.crt.component.IComponentInfo
Returns:
the component's human-readable name or null .

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Description copied from interface: IComponentInfo
Returns a description of the components purpose or null .
Specified by:
getDescription in interface IComponentInfo
Following copied from interface: com.sapportals.wcm.crt.component.IComponentInfo
Parameters:
locale - Selects the language of the description text - can be null .
Returns:
a description of the components purpose or null .

getProperties

public java.util.Properties getProperties()
Description copied from interface: IComponentInfo
Returns some arbitrary properties with information about the component or null .
Specified by:
getProperties in interface IComponentInfo
Following copied from interface: com.sapportals.wcm.crt.component.IComponentInfo
Returns:
some arbitrary properties with information about the component or null .

getLastConfigurationException

public ConfigurationException getLastConfigurationException()
Description copied from interface: ILifecycleInfo
Returns the exception thrown in the last call to IConfigurable.configure(IConfiguration), or IReconfigurable.reconfigure(IConfiguration). Can be null .
Specified by:
getLastConfigurationException in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
lastConfigurationException

getStartupException

public StartupException getStartupException()
Description copied from interface: ILifecycleInfo
Returns the exception thrown in the last call to IStartable.start(), Can be null .
Specified by:
getStartupException in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
startupException

getLastReconfigurationDate

public java.util.Date getLastReconfigurationDate()
Description copied from interface: ILifecycleInfo
Returns the date and time of the last reconfiguration of this component. Can be null .
Specified by:
getLastReconfigurationDate in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
the date and time of the last reconfiguration of this component. Can be null .

getNextAutoRestartDate

public java.util.Date getNextAutoRestartDate()
Description copied from interface: ILifecycleInfo
Returns the date and time of the next automatic restart of the component. Can be null .
Specified by:
getNextAutoRestartDate in interface ILifecycleInfo
Following copied from interface: com.sapportals.wcm.crt.component.ILifecycleInfo
Returns:
the date and time of the next automatic restart of the component. Can be null .
See Also:
AutoRestartException

mustSendResourceEventType

public final boolean mustSendResourceEventType(int type)
ResourceImpl will call this method to check if a given resource event type must be sent at all.
Parameters:
type - the type of ResourceEvent to send
Returns:
true, if the given ResourceEvent type has to be sent, false if no receiver registered for this ResourceEvent type

sendEvent

public final IResourceEvent sendEvent(IResource resource,
                                      int type,
                                      java.lang.String correlationId,
                                      java.lang.Object param)
ResourceImpl will call this method to send the standard resource events
Parameters:
type - The event type (ResourceEvent.XXX constant)
resource - The resource the event belongs to
param - The event parameter
correlationId - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

eventsEnabled

public final boolean eventsEnabled()
Returns true if standard resource events should be sent by the framework.
Returns:
true if standard resource events should be sent by the framework.

configure

public final void configure(IConfiguration config)
                     throws ConfigurationException
Description copied from interface: IConfigurable
Passes the configuration data to the configurable. This method will by called by the CRT only once. It is called after construction and contextualization and before startup (if implemented).
Specified by:
configure in interface IConfigurable
Following copied from interface: com.sapportals.wcm.crt.component.IConfigurable
Parameters:
configuration - the component's configuration data.
Throws:
ConfigurationException - Exception raised in failure situation

start

public final void start()
                 throws StartupException
Description copied from interface: IStartable
A component must implement this method if it has initial startup handling to do before being accessible (acquire resources, open connections to remote systems, etc). This method is only called once during the life-time of a component except an AutoRestartException was thrown.
Specified by:
start in interface IStartable
Following copied from interface: com.sapportals.wcm.crt.component.IStartable
Throws:
StartupException - If the initialization failed because neccessary resources could not be allocated.

stop

public final void stop()
Description copied from interface: IStartable
This method is only called once during the life-time of a component. It is called by the CRT when the component was removed from the configuration or the system shuts down. A stopped component can not be (re)started. After a shutdown the component instance will be finalized by the Java VM as soon as no other components in the system holds a reference to it.
Specified by:
stop in interface IStartable

contextualize

public void contextualize(IContext context)
                   throws ContextException
Description copied from interface: IContextualizable
Pass the context to the component.
Specified by:
contextualize in interface IContextualizable
Following copied from interface: com.sapportals.wcm.crt.component.IContextualizable
Parameters:
context - The context objects
Throws:
ContextException - if the context is invalid

startUpImpl

protected void startUpImpl()
                    throws ConfigurationException,
                           StartupException
The implementation must overwrite this method if it has initial startup handling to do (acquire resources, open connections to remote systems, etc). Accoring to the contract of the IStartable interface of the CRT this method will be called only once. It will be called on systen start up or when a new instance of this component is added to the persistence configuration.
Throws:
ConfigurationException -  
StartupException -  

shutDownImpl

protected void shutDownImpl()
The implementation must overwrite this method if it has to release resources acquired during shutdown. Accoring to the contract of the IStartable interface of the CRT this method will be called only once. It will be called when the component is removed from the persistent configuration or when the system shuts down.

checkNotReconfigurableAttributes

protected final void checkNotReconfigurableAttributes(java.lang.String[] notReconfigurable,
                                                      IConfiguration newConfig)
                                               throws ConfigurationException
Helper method for reconfigure() implementations. Throws a configuration exception if any of the specified attributes or any of the not reconfigurable framework attributes (e.g. prefix) has changed.
Parameters:
notReconfigurable - An array of names of attributes that cannot be canged wihout restarting the component/server.
newConfig - The new configuration data received as argument of the reconfigure() method.
Throws:
ConfigurationException -  

registerSecurityManager

protected void registerSecurityManager(java.lang.String name,
                                       java.lang.String manager)

reconfigureSecurityManager

protected final boolean reconfigureSecurityManager(IConfiguration newConfig)
                                            throws ConfigurationException
Must be called by the RM implementation in its reconfigure() method if reconfiguration of security managers at runtime must be supported.
Parameters:
newConfig - The new configuration data (paramater of the reconfigure() method).
Returns:
true if the security manager was changed (removed, added or different sub manager), false otherwise.
Throws:
ConfigurationException - If the new sub manager can not be started. If the sub manager implements other sub manager interfaces than ISecurityManager. If the sub manager does not implement ISecurityManager. If the sub manager does not extend AbstractRepositorySubManager.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public final boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.