org.apache.felix.jmood.compendium
Class ConfigAdminManager

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.apache.felix.jmood.compendium.ConfigAdminManager
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ConfigAdminManagerMBean

public class ConfigAdminManager
extends javax.management.NotificationBroadcasterSupport
implements javax.management.MBeanRegistration, ConfigAdminManagerMBean

This is the main class of the config admin module. As such, it is responsible for controlling all the issues related to it. This class implements the ConfigAdminManagerMXBean which defines its management interface. It creates a ConfigurationDelegate object for each available Configuration object.


Constructor Summary
ConfigAdminManager(AgentContext ac)
           
 
Method Summary
 void addPropertyToConfigurations(String filter, String name, String value, String type)
          Updates or adds a property to configurations selected by an LDAP expression Arrays and vectors not supported
protected static Object castValueToType(String type, String value)
           
 String createFactoryConfiguration(String pid)
           
 String createFactoryConfiguration(String pid, String location)
           
 void deleteConfigurations(String filter)
          Delete the configurations identified by the LDAP filter
 String getConfiguration(String pid)
           
 String getConfiguration(String pid, String location)
          This method gets a configuration object related to a pid and a bundle location
 boolean isAvailable()
           
protected static boolean isValidType(String type)
          Validate that the value type is supported
 String[] listConfigurations(String filter)
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          This is called before the module is loaded.
 void refresh()
           
 void removePropertyFromConfigurations(String filter, String name)
          Removes a property from all the configurations selected by an LDAP expression
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigAdminManager

public ConfigAdminManager(AgentContext ac)
Method Detail

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws Exception
This is called before the module is loaded. It initializes the module.

Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
Exception
See Also:
MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration
See Also:
MBeanRegistration.postRegister(java.lang.Boolean)

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
Exception
See Also:
MBeanRegistration.preDeregister()

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration
See Also:
MBeanRegistration.postDeregister()

listConfigurations

public String[] listConfigurations(String filter)
                            throws Exception
Specified by:
listConfigurations in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.listConfigurations(java.lang.String)

getConfiguration

public String getConfiguration(String pid)
                        throws Exception
Specified by:
getConfiguration in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.getConfiguration(java.lang.String)

getConfiguration

public String getConfiguration(String pid,
                               String location)
                        throws Exception
This method gets a configuration object related to a pid and a bundle location

Specified by:
getConfiguration in interface ConfigAdminManagerMBean
Parameters:
pid - Persistent ID
location - Bundle location of the service
Throws:
Exception
See Also:
ConfigAdminManagerMBean.getConfiguration(java.lang.String, java.lang.String)

createFactoryConfiguration

public String createFactoryConfiguration(String pid)
                                  throws Exception
Specified by:
createFactoryConfiguration in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.createFactoryConfiguration(java.lang.String)

createFactoryConfiguration

public String createFactoryConfiguration(String pid,
                                         String location)
                                  throws Exception
Specified by:
createFactoryConfiguration in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.createFactoryConfiguration(java.lang.String, java.lang.String)

deleteConfigurations

public void deleteConfigurations(String filter)
                          throws Exception
Delete the configurations identified by the LDAP filter

Specified by:
deleteConfigurations in interface ConfigAdminManagerMBean
Parameters:
filter - LDAP String representing the configurations that want to be deleted
Throws:
Exception
See Also:
ConfigAdminManagerMBean.deleteConfigurations(java.lang.String)

removePropertyFromConfigurations

public void removePropertyFromConfigurations(String filter,
                                             String name)
                                      throws Exception
Removes a property from all the configurations selected by an LDAP expression

Specified by:
removePropertyFromConfigurations in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.removePropertyFromConfigurations(java.lang.String, java.lang.String)

addPropertyToConfigurations

public void addPropertyToConfigurations(String filter,
                                        String name,
                                        String value,
                                        String type)
                                 throws Exception
Updates or adds a property to configurations selected by an LDAP expression Arrays and vectors not supported

Specified by:
addPropertyToConfigurations in interface ConfigAdminManagerMBean
Throws:
Exception
See Also:
ConfigAdminManagerMBean.addPropertyToConfigurations(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

isValidType

protected static boolean isValidType(String type)
Validate that the value type is supported

Parameters:
type -

castValueToType

protected static Object castValueToType(String type,
                                        String value)

refresh

public void refresh()
             throws Exception
Specified by:
refresh in interface ConfigAdminManagerMBean
Throws:
Exception

isAvailable

public boolean isAvailable()
Specified by:
isAvailable in interface ConfigAdminManagerMBean


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.