public class ComponentConfiguration extends Facade implements ComponentConfiguration, Constants
| Modifier and Type | Class and Description |
|---|---|
protected class |
ComponentConfiguration.ComponentConfigurationResponse
The component configuration response for a target has two pieces of information
The attributes which were set successfully
A management XML message with details
|
| Modifier and Type | Field and Description |
|---|---|
protected ComponentConfigurationHelper |
mCfgHlpr
Component Configuration Helper
|
protected String |
mComponentName
The component name
|
protected ComponentType |
mComponentType
Component Type : BINDING / ENGINE ?
|
protected Document |
mConfigDoc
Configuration meta-data
|
CONFIG_SCHEMA_PATH, DOMAIN, MASKED_FIELD_VALUE, mComponentConfigSchema, mEnvCtx, mLog, mMBeanNames, mMBeanSvr, mMgtCtx, mMsgBuilder, mPlatform, mTarget, mTranslator, PASSWORD, SERVER, sTypeMap, WORKSPACE_ROOTADMIN_RUNNING_FILE, ADMIN_STOPPED_FILE, CONFIG_NAME_KEY, LOG_LEVEL_DEFAULT, TMP_FOLDER| Constructor and Description |
|---|
ComponentConfiguration(EnvironmentContext ctx,
String target,
String compName,
ComponentType compType) |
| Modifier and Type | Method and Description |
|---|---|
String |
addApplicationConfiguration(String name,
CompositeData appConfig)
Add an application configuration.
|
String |
addApplicationConfiguration(String name,
Properties appCfgProps)
Add an application configuration.
|
protected String |
addApplicationConfigurationToInstance(String name,
CompositeData appCfg,
String instanceName)
If the instance is running, add the application config
|
String |
addApplicationVariable(String name,
CompositeData appVar)
This operation adds a new application variable.
|
protected String |
addApplicationVariableToInstance(String name,
CompositeData appVar,
String instanceName)
If the instance is running, set the attribute on the component configuration MBean.
|
protected void |
applicationConfigurationCompositeIntegrityCheck(String name,
CompositeData appConfig,
boolean isUpdate)
Check if the configurationName key exists and matches the name passed in.
|
protected void |
applicationConfigurationCompositeIntegrityCheck(String name,
Properties appCfgProps,
boolean isUpdate)
Check if the configurationName key exists and matches the name passed in.
|
protected void |
applicationConfigurationExistsCheck(String configName,
boolean throwIfMissing)
Check if the application configuration by the name is already defined.
|
protected boolean |
applicationConfigurationExistsInstanceCheck(String configName,
String instance)
Check if the application configuration by the name is already defined.
|
protected void |
applicationVariableCompositeIntegrityCheck(String name,
String type,
CompositeData appVar,
boolean isUpdate)
Check if the name string matches the application variable name
|
protected String |
applicationVariableExistsCheck(String name,
boolean shouldExist)
Check for the existance of an application variable.
|
protected boolean |
applicationVariableExistsInstanceCheck(String name,
String instance)
Check for the existance of an application variable.
|
protected String |
attribListToString(AttributeList attribList)
Convert attribute list to a String value
|
protected void |
attributeCheck(Attribute attribute)
Check if the attribute is valid i.e. the MBeanInfo of the
ComponentConfigurationMBean has these attributes and the values are of the
same type.
|
protected void |
attributeCheck(AttributeList attributeList)
Check if all the attributes in the attribute list are valid i.e. the MBeanInfo
of the ComponentConfigurationMBean has these attributes and the values are of the
same type
|
protected void |
attributeCheck(String attributeName)
Check if the attribute is valid i.e. the MBeanInfo of the
ComponentConfigurationMBean has this attribute.
|
protected void |
attributeCheck(String[] attributeList)
Check if all the attributes in the list are valid i.e. the MBeanInfo
of the ComponentConfigurationMBean has these attributes
|
protected void |
canListAppConfigCheck()
Check if the component is started on the target, if it is not then a exception is
thrown.
|
protected void |
checkAppVarValue(String name,
String type,
String value)
Ensures that values of BOOLEAN application variable types are
either "true" or "false", and value of NUMBER types is a number
|
protected void |
componentStartedOrStoppedOnTargetCheck()
Check if the component is started or stopped on the target, if it is not then a exception is
thrown.
|
protected TabularData |
createEmptyAppConfigTable() |
protected TabularData |
createEmptyAppVarTable() |
String |
deleteApplicationConfiguration(String name)
Delete an application configuration.
|
protected String |
deleteApplicationConfigurationFromInstance(String name,
String instanceName)
If the instance is running, delete the application config
|
String |
deleteApplicationVariable(String name)
This operation deletes an application variable, if a variable with the specified name does
not exist, it's an error.
|
protected String |
deleteApplicationVariableFromInstance(String name,
String instanceName)
If the instance is running, delete the application variable from the
component configuration MBean.
|
TabularData |
getApplicationConfigurations()
Get a Map of all application configurations for the component.
|
TabularData |
getApplicationConfigurationsForInstance(String instance)
Get a Map of all application configurations for the component on a instance.
|
TabularData |
getApplicationVariables()
Get the Application Variable set for a component.
|
TabularData |
getApplicationVariablesForInstance(String instance)
Get the Application Variable set for a component.
|
Object |
getAttribute(String attribute)
Obtain the value of a specific attribute of the Dynamic MBean.
|
protected MBeanAttributeInfo |
getAttributeInfo(String attribute) |
AttributeList |
getAttributes(String[] attributes)
Get the values of several attributes of the Dynamic MBean.
|
protected MBeanInfo |
getComponentMBeanInfo()
Get the MBeanInfo from the actual component configuration MBean.
|
protected Document |
getConfigDoc() |
MBeanInfo |
getMBeanInfo()
Provides the exposed attributes and actions of the Dynamic MBean using
an MBeanInfo object.
|
protected ObjectName |
getRemoteInstanceComponentConfigMBeanName(String instanceName)
Get the name of the instance Configuration MBean.
|
Object |
invoke(String actionName,
Object[] params,
String[] signature)
Allows an action to be invoked on the Dynamic MBean.
|
boolean |
isAppConfigSupported()
Detect the components support for application configuration.
|
boolean |
isAppVarsSupported()
Detect the components support for application variables.
|
protected boolean |
isBoolean(String str) |
boolean |
isComponentConfigSupported()
Detect the components support for component configuration.
|
protected boolean |
isNumber(String str) |
protected MBeanOperationInfo[] |
merge(MBeanOperationInfo[] a1,
MBeanOperationInfo[] a2)
Merge two MBeanOperationInfo arrays.
|
CompositeType |
queryApplicationConfigurationType()
Get the CompositeType definition for the components application configuration
|
String |
retrieveConfigurationDisplayData()
Retrieves the component configuration metadata.
|
String |
retrieveConfigurationDisplaySchema()
Retrieves the component specific configuration schema.
|
String |
setApplicationConfiguration(String name,
CompositeData appConfig)
Update a application configuration.
|
String |
setApplicationConfiguration(String name,
Properties appCfgProps)
Set an application configuration.
|
protected String |
setApplicationConfigurationOnInstance(String name,
CompositeData appCfg,
String instanceName)
If the instance is running, set the application config
|
String |
setApplicationVariable(String name,
CompositeData appVar)
This operation sets an application variable.
|
protected String |
setApplicationVariableOnInstance(String name,
CompositeData appVar,
String instanceName)
If the instance is running, set the application variable component configuration MBean.
|
void |
setAttribute(Attribute attribute)
Set the value of a specific attribute of the Dynamic MBean.
|
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of several attributes of the Dynamic MBean.
|
String |
setConfigurationAttribute(Attribute attrib)
Set a single configuration attribute on a target.
|
protected String |
setConfigurationAttributeOnInstance(Attribute attrib,
String instanceName)
If the instance is running, set the attribute on the component configuration MBean.
|
String |
setConfigurationAttributes(AttributeList attribList) |
protected ComponentConfiguration.ComponentConfigurationResponse |
setConfigurationAttributesOnInstance(AttributeList attribList,
String instanceName)
If the instance is running, set the attributes on the instance
component configuration action MBean.
|
protected void |
supportsAppConfigCheck()
Check if the component supports application configuration.
|
protected void |
supportsAppVarsCheck()
Check if the component supports application variables.
|
archiveEqualityCheck, areAllInstancesUp, componentInstallationCheck, convertToString, fromFileURL, getAllTargets, getComponentConfigurationData, getComponentConfigurationNS, getComponentConfigurationSchema, getComponentLifeCycleMBeanName, getComponentQuery, getComponentQuery, getComponentState, getComponentStateOnInstance, getComponentType, getFacadeInstallerMBeanName, getFacadeInstallerMBeanName, getGenericQuery, getMBeanServerConnection, getRegistry, getRemoteAdminServiceObjectName, getRemoteAttribute, getRemoteAttributes, getServiceAssemblyQuery, getUpdater, handleClusteredInstanceFailures, initPrimitiveTypeMap, instanceRunningCheck, invokeLocalOperation, invokeRemoteOperation, invokeRemoteVoidOperation, isComponentInstalled, isInstanceRunning, isMBeanRegisteredOnInstance, isSharedLibraryInstalled, isTargetUp, mbeanRegistrationCheck, setRemoteAttribute, setRemoteAttributes, sharedLibraryInstallationCheck, throwNotSupportedManagementException, toFileURL, unregisterComponentConfigurationMBean, unregisterComponentConfigurationMBean, unregisterComponentExtensionMBean, unregisterComponentExtensionMBean, unregisterComponentLifeCycleMBean, unregisterComponentLifeCycleMBean, uploadFile, validateArchiveprotected String mComponentName
protected ComponentType mComponentType
protected ComponentConfigurationHelper mCfgHlpr
protected Document mConfigDoc
public ComponentConfiguration(EnvironmentContext ctx, String target, String compName, ComponentType compType) throws ManagementException
ManagementExceptionpublic Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute in interface DynamicMBeanattribute - The name of the attribute to be retrievedAttributeNotFoundExceptionMBeanException - Wraps a java.lang.Exception
thrown by the MBean's getter.ReflectionException - Wraps a java.lang.Exception
thrown while trying to invoke the getter.setAttribute(javax.management.Attribute)public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute in interface DynamicMBeanattribute - The identification of the attribute to
be set and the value it is to be set to.AttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanException - Wraps a java.lang.Exception
thrown by the MBean's setter.ReflectionException - Wraps a java.lang.Exception
thrown while trying to invoke the MBean's setter.getAttribute(java.lang.String)public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke in interface DynamicMBeanactionName - The name of the action to be invoked.params - An array containing the parameters to be set when the
action is invoked.signature - An array containing the signature of the action. The
class objects will be loaded through the same class loader as the
one used for loading the MBean on which the action is invoked.MBeanException - Wraps a java.lang.Exception thrown
by the MBean's invoked method.ReflectionException - Wraps a java.lang.Exception
thrown while trying to invoke the methodpublic AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBeanattributes - A list of attributes: The identification of the
attributes to be set and the values they are to be set to.getAttributes(java.lang.String[])public MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBeanMBeanInfo allowing all attributes
and actions exposed by this Dynamic MBean to be retrieved.public AttributeList getAttributes(String[] attributes)
getAttributes in interface DynamicMBeanattributes - A list of the attributes to be retrieved.setAttributes(javax.management.AttributeList)public String setConfigurationAttribute(Attribute attrib) throws JBIException
attrib - - the configuration attribute to be set.JBIExceptionpublic String setConfigurationAttributes(AttributeList attribList) throws JBIException
JBIExceptionpublic boolean isAppVarsSupported()
throws MBeanException
isAppVarsSupported in interface ComponentConfigurationMBeanException - if the component is not installed or is not
in the Started state.public String addApplicationVariable(String name, CompositeData appVar) throws MBeanException
addApplicationVariable in interface ComponentConfigurationname - - name of the application variableappVar - - this is the application variable compoisteMBeanException - if an error occurs in adding the application variables to the
component.public String setApplicationVariable(String name, CompositeData appVar) throws MBeanException
setApplicationVariable in interface ComponentConfigurationname - - name of the application variableappVar - - this is the application variable compoiste to be updated.MBeanException - if one or more application variables cannot be deletedpublic String deleteApplicationVariable(String name) throws MBeanException
deleteApplicationVariable in interface ComponentConfigurationname - - name of the application variableMBeanException - on errors.public TabularData getApplicationVariables()
getApplicationVariables in interface ComponentConfigurationpublic TabularData getApplicationVariablesForInstance(String instance)
public boolean isComponentConfigSupported()
throws MBeanException
isComponentConfigSupported in interface ComponentConfigurationMBeanException - if the component is not installed or is not
in the Started state.public boolean isAppConfigSupported()
throws MBeanException
isAppConfigSupported in interface ComponentConfigurationMBeanException - if the component is not installed or is not
in the Started state.public CompositeType queryApplicationConfigurationType()
queryApplicationConfigurationType in interface ComponentConfigurationpublic String addApplicationConfiguration(String name, Properties appCfgProps) throws MBeanException
addApplicationConfiguration in interface ComponentConfigurationname - - configuration name, must match the value of the field "name" in the namedConfigappCfgProps - - application configuration propertiesMBeanException - if the application configuration cannot be added.public String addApplicationConfiguration(String name, CompositeData appConfig) throws MBeanException
addApplicationConfiguration in interface ComponentConfigurationname - - configuration name, must match the value of the field "name" in the namedConfigappConfig - - application configuration compositeMBeanException - if the application configuration cannot be added.public String deleteApplicationConfiguration(String name) throws MBeanException
deleteApplicationConfiguration in interface ComponentConfigurationname - - identification of the application configuration to be deletedMBeanException - if the configuration cannot be deleted.public String setApplicationConfiguration(String name, Properties appCfgProps) throws MBeanException
setApplicationConfiguration in interface ComponentConfigurationname - - configuration name, must match the value of the field "name" in the namedConfigappCfgProps - - application configuration propertiesMBeanException - if the application configuration cannot be set.public String setApplicationConfiguration(String name, CompositeData appConfig) throws MBeanException
setApplicationConfiguration in interface ComponentConfigurationname - - configuration name, must match the value of the field "configurationName" in the appConfigappConfig - - application configuration compositeMBeanException - if there are errors encountered when updating the configuration.public TabularData getApplicationConfigurations()
getApplicationConfigurations in interface ComponentConfigurationpublic TabularData getApplicationConfigurationsForInstance(String instance)
instance - the instance to checkpublic String retrieveConfigurationDisplaySchema() throws MBeanException
retrieveConfigurationDisplaySchema in interface ComponentConfigurationMBeanExceptionpublic String retrieveConfigurationDisplayData() throws MBeanException
retrieveConfigurationDisplayData in interface ComponentConfigurationMBeanExceptionprotected MBeanInfo getComponentMBeanInfo()
protected ObjectName getRemoteInstanceComponentConfigMBeanName(String instanceName)
instanceName - - instance nameprotected String setConfigurationAttributeOnInstance(Attribute attrib, String instanceName) throws ManagementException
attrib - - management attribute to setinstanceName - - instance nameManagementExceptionprotected ComponentConfiguration.ComponentConfigurationResponse setConfigurationAttributesOnInstance(AttributeList attribList, String instanceName) throws ManagementException
attribList - - management attribute to setinstanceName - - instance nameManagementExceptionprotected MBeanOperationInfo[] merge(MBeanOperationInfo[] a1, MBeanOperationInfo[] a2)
array1 - -array2 - protected void componentStartedOrStoppedOnTargetCheck()
throws JBIException
JBIException - if the component is not started or stopped on the target.protected void canListAppConfigCheck()
throws JBIException
JBIException - if the component is not started on the target,
indicating one cannot list application configuration.protected void attributeCheck(AttributeList attributeList) throws JBIException
attributeList - - list of attributesJBIException - if a attribute value is not of the type
expected or if the provided attributeList has an attribute
which is not present in the AttributeInfoprotected void attributeCheck(Attribute attribute) throws JBIException
attribute - - the attribute to be checkedJBIException - if the attribute value is not of the type
expected or if the provided attribute
is not present in the AttributeInfoprotected void attributeCheck(String[] attributeList) throws JBIException
attributeList - - list of attribute namesJBIException - if the provided attributeList has an attribute
which is not present in the AttributeInfoprotected void attributeCheck(String attributeName) throws JBIException
attribute - - the attribute to be checkedJBIException - if the provided attribute
is not present in the AttributeInfoprotected MBeanAttributeInfo getAttributeInfo(String attribute)
attribName - - identification of the attributeprotected String applicationVariableExistsCheck(String name, boolean shouldExist) throws JBIException
JBIExceptionprotected boolean applicationVariableExistsInstanceCheck(String name, String instance)
protected void applicationVariableCompositeIntegrityCheck(String name, String type, CompositeData appVar, boolean isUpdate) throws JBIException
name - - application variable should have the same nametype - - existing application variable type, if app var exists,
null other wise.appVar - - application variable compoiste to checkJBIExceptionprotected String addApplicationVariableToInstance(String name, CompositeData appVar, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application variableappvar - - the application variable being setManagementExceptionprotected String setApplicationVariableOnInstance(String name, CompositeData appVar, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application variableappvar - - the application variable being setManagementExceptionprotected String deleteApplicationVariableFromInstance(String name, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application variableappvar - - the application variable being setManagementExceptionprotected void applicationConfigurationCompositeIntegrityCheck(String name, CompositeData appConfig, boolean isUpdate) throws JBIException
name - - application configuration should have the same nameappConfig - - application configuration compoiste to checkisUpdate - - true when this method is invoked when a config is
being updated.JBIExceptionprotected void applicationConfigurationCompositeIntegrityCheck(String name, Properties appCfgProps, boolean isUpdate) throws JBIException
name - - application configuration should have the same nameappCfgProps - - application configuration properties to checkisUpdate - - true when this method is invoked when a config is
being updated.JBIExceptionprotected String addApplicationConfigurationToInstance(String name, CompositeData appCfg, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application configurationappCfg - - the application config being setManagementExceptionprotected String setApplicationConfigurationOnInstance(String name, CompositeData appCfg, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application configurationappCfg - - the application config being setManagementExceptionprotected String deleteApplicationConfigurationFromInstance(String name, String instanceName) throws ManagementException
instanceName - - server namename - - name of the application configurationappCfg - - the application config being setManagementExceptionprotected void applicationConfigurationExistsCheck(String configName, boolean throwIfMissing) throws JBIException
configName - application configuration namethrowIfMissing - boolean flag if set to true anexception is thrown if the
configuration is not defined, if this is false an exception is
thrown if the configuration is defined.JBIExceptionprotected boolean applicationConfigurationExistsInstanceCheck(String configName, String instance)
configName - application configuration nameprotected void supportsAppVarsCheck()
throws JBIException,
MBeanException
JBIException - if the component does not support
application variablesMBeanExceptionprotected void supportsAppConfigCheck()
throws JBIException,
MBeanException
JBIException - if the component does not support
application configurationMBeanExceptionprotected TabularData createEmptyAppConfigTable() throws OpenDataException
OpenDataExceptionprotected TabularData createEmptyAppVarTable() throws OpenDataException
OpenDataExceptionprotected Document getConfigDoc() throws ManagementException
ManagementExceptionprotected String attribListToString(AttributeList attribList)
attribList - the AttributeList to be convertedprotected void checkAppVarValue(String name, String type, String value) throws JBIException
type - value - JBIExceptionprotected boolean isNumber(String str)
protected boolean isBoolean(String str)
Copyright © 2011-2016 OpenESB Community. All Rights Reserved.