Author: tejones
Date: 2010-05-28 09:31:10 -0400 (Fri, 28 May 2010)
New Revision: 2168
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Adding update logic for property persistence
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 04:39:38 UTC
(rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-05-28 13:31:10 UTC
(rev 2168)
@@ -39,6 +39,7 @@
import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
@@ -74,6 +75,7 @@
import org.teiid.rhq.comm.ExecutedResult;
import org.teiid.rhq.plugin.objects.ExecutedOperationResultImpl;
import org.teiid.rhq.plugin.util.DeploymentUtils;
+import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
/**
@@ -169,8 +171,8 @@
public void setResourceConfiguration(Configuration resourceConfiguration) {
this.resourceConfiguration = resourceConfiguration;
}
-
- public String getComponentName() {
+
+ public String componentType() {
return name;
}
@@ -191,7 +193,7 @@
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
"Not implemented on component type " + this.getComponentType()
- + " named " + this.getComponentName());
+ + " named " + this.name);
}
@@ -200,7 +202,7 @@
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
"Not implemented on component type " + this.getComponentType()
- + " named " + this.getComponentName());
+ + " named " + this.name);
}
@@ -306,12 +308,80 @@
* @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
*/
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
- // this simulates the plugin taking the new configuration and
- // reconfiguring the managed resource
+
resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+
+ ManagementView managementView = null;
+ ComponentType componentType = null;
+ if (this.getComponentType().equals(PluginConstants.ComponentType.VDB.NAME)) {
+ componentType = new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE);
+ } else if (this.getComponentType()
+ .equals(PluginConstants.ComponentType.Translator.NAME)) {
+ componentType = new ComponentType(
+ PluginConstants.ComponentType.Translator.TYPE,
+ PluginConstants.ComponentType.Translator.SUBTYPE);
+ } else {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage("Update not implemented for the component type.");
+ }
+
+ ManagedComponent managedComponent = null;
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ managedComponent = managementView.getComponent(this.name, componentType);
+ Map<String, ManagedProperty> managedProperties = managedComponent
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceContext
+ .getResourceType());
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
}
+ /**
+ * @return
+ * @throws Exception
+ */
+ protected Map<String, ManagedProperty> getManagedProperties()
+ throws Exception {
+ return null;
+ }
+
+ /**
+ * @param managedComponent
+ * @throws Exception
+ */
+ protected void updateComponent(ManagedComponent managedComponent)
+ throws Exception {
+ log.trace("Updating " + this.name + " with component "
+ + managedComponent.toString() + "...");
+ ManagementView managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), false);
+ managementView.updateComponent(managedComponent);
+
+ }
+
@Override
public void deleteResource() throws Exception {
@@ -407,7 +477,6 @@
return null;
}
-
protected static Configuration getDefaultPluginConfiguration(
ResourceType resourceType) {
ConfigurationTemplate pluginConfigDefaultTemplate = resourceType
@@ -416,92 +485,94 @@
.createConfiguration()
: new Configuration();
}
-
-
- /* (non-Javadoc)
- * @see
org.rhq.core.pluginapi.inventory.CreateChildResourceFacet#createResource(org.rhq.core.pluginapi.inventory.CreateResourceReport)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.rhq.core.pluginapi.inventory.CreateChildResourceFacet#createResource
+ * (org.rhq.core.pluginapi.inventory.CreateResourceReport)
*/
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
ResourceType resourceType = report.getResourceType();
- if (resourceType.getName().equals("Translators")){
+ if (resourceType.getName().equals("Translators")) {
createConfigurationBasedResource(report);
- }else{
+ } else {
createContentBasedResource(report);
}
-
+
return report;
}
-
+
private CreateResourceReport createConfigurationBasedResource(
CreateResourceReport createResourceReport) {
ResourceType resourceType = createResourceReport.getResourceType();
- Configuration defaultPluginConfig =
- getDefaultPluginConfiguration(resourceType);
- Configuration resourceConfig = createResourceReport
- .getResourceConfiguration();
- String resourceName = getResourceName(defaultPluginConfig,
- resourceConfig);
- ComponentType componentType = ProfileServiceUtil
- .getComponentType(resourceType);
- ManagementView managementView = null;;
- try {
- managementView = ProfileServiceUtil.getManagementView(
- ProfileServiceUtil.getProfileService(), true);
- } catch (NamingException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- if (ProfileServiceUtil.isManagedComponent(managementView,
- resourceName, componentType)) {
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setErrorMessage("A " + resourceType.getName()
- + " named '" + resourceName + "' already exists.");
- return createResourceReport;
- }
+ Configuration defaultPluginConfig = getDefaultPluginConfiguration(resourceType);
+ Configuration resourceConfig = createResourceReport
+ .getResourceConfiguration();
+ String resourceName = getResourceName(defaultPluginConfig,
+ resourceConfig);
+ ComponentType componentType = ProfileServiceUtil
+ .getComponentType(resourceType);
+ ManagementView managementView = null;
+ ;
+ try {
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ } catch (NamingException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (ProfileServiceUtil.isManagedComponent(managementView, resourceName,
+ componentType)) {
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setErrorMessage("A " + resourceType.getName()
+ + " named '" + resourceName + "' already exists.");
+ return createResourceReport;
+ }
- createResourceReport.setResourceName(resourceName);
- String resourceKey = getResourceKey(resourceType, resourceName);
- createResourceReport.setResourceKey(resourceKey);
+ createResourceReport.setResourceName(resourceName);
+ String resourceKey = getResourceKey(resourceType, resourceName);
+ createResourceReport.setResourceKey(resourceKey);
- PropertySimple templateNameProperty = resourceConfig
- .getSimple(TranslatorComponent.Config.TEMPLATE_NAME);
- String templateName = templateNameProperty.getStringValue();
+ PropertySimple templateNameProperty = resourceConfig
+ .getSimple(TranslatorComponent.Config.TEMPLATE_NAME);
+ String templateName = templateNameProperty.getStringValue();
- DeploymentTemplateInfo template;
- Set templateNamesSet = managementView.getTemplateNames();
+ DeploymentTemplateInfo template;
+ Set templateNamesSet = managementView.getTemplateNames();
+ try {
+ template = managementView.getTemplate(templateName);
+ Map<String, ManagedProperty> managedProperties = template
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceType);
+
+ LOG.debug("Applying template [" + templateName
+ + "] to create ManagedComponent of type [" + componentType
+ + "]...");
try {
- template = managementView.getTemplate(templateName);
- Map<String, ManagedProperty> managedProperties = template
- .getProperties();
-
- ProfileServiceUtil.convertConfigurationToManagedProperties(
- managedProperties, resourceConfig, resourceType);
-
- LOG.debug("Applying template [" + templateName
- + "] to create ManagedComponent of type [" + componentType
- + "]...");
- try {
- managementView.applyTemplate(resourceName, template);
- managementView.process();
- createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
- } catch (Exception e) {
- LOG.error("Unable to apply template [" + templateName
- + "] to create ManagedComponent of type "
- + componentType + ".", e);
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setException(e);
- }
- } catch (NoSuchDeploymentException e) {
- LOG.error("Unable to find template [" + templateName + "].", e);
- createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setException(e);
+ managementView.applyTemplate(resourceName, template);
+ managementView.process();
+ createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
} catch (Exception e) {
- LOG.error("Unable to process create request", e);
+ LOG.error("Unable to apply template [" + templateName
+ + "] to create ManagedComponent of type "
+ + componentType + ".", e);
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(e);
}
+ } catch (NoSuchDeploymentException e) {
+ LOG.error("Unable to find template [" + templateName + "].", e);
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setException(e);
+ } catch (Exception e) {
+ LOG.error("Unable to process create request", e);
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setException(e);
+ }
return createResourceReport;
}
@@ -545,29 +616,35 @@
}
}
-
- private static String getResourceName(Configuration pluginConfig, Configuration
resourceConfig)
- {
- PropertySimple resourceNameProp =
pluginConfig.getSimple(TranslatorComponent.Config.RESOURCE_NAME);
- if (resourceNameProp == null || resourceNameProp.getStringValue() == null)
- throw new IllegalStateException("Property [" +
TranslatorComponent.Config.RESOURCE_NAME
- + "] is not defined in the default plugin
configuration.");
- String resourceNamePropName = resourceNameProp.getStringValue();
- PropertySimple propToUseAsResourceName =
resourceConfig.getSimple(resourceNamePropName);
- if (propToUseAsResourceName == null)
- throw new IllegalStateException("Property [" +
resourceNamePropName
- + "] is not defined in initial Resource configuration.");
- return propToUseAsResourceName.getStringValue();
- }
-
- private String getResourceKey(ResourceType resourceType, String resourceName)
- {
- ComponentType componentType = ProfileServiceUtil.getComponentType(resourceType);
- if (componentType == null)
- throw new IllegalStateException("Unable to map " + resourceType +
" to a ComponentType.");
- return componentType.getType() + ":" + componentType.getSubtype() +
":" + resourceName;
- }
+ private static String getResourceName(Configuration pluginConfig,
+ Configuration resourceConfig) {
+ PropertySimple resourceNameProp = pluginConfig
+ .getSimple(TranslatorComponent.Config.RESOURCE_NAME);
+ if (resourceNameProp == null
+ || resourceNameProp.getStringValue() == null)
+ throw new IllegalStateException("Property ["
+ + TranslatorComponent.Config.RESOURCE_NAME
+ + "] is not defined in the default plugin configuration.");
+ String resourceNamePropName = resourceNameProp.getStringValue();
+ PropertySimple propToUseAsResourceName = resourceConfig
+ .getSimple(resourceNamePropName);
+ if (propToUseAsResourceName == null)
+ throw new IllegalStateException("Property [" + resourceNamePropName
+ + "] is not defined in initial Resource configuration.");
+ return propToUseAsResourceName.getStringValue();
+ }
+
+ private String getResourceKey(ResourceType resourceType, String resourceName) {
+ ComponentType componentType = ProfileServiceUtil
+ .getComponentType(resourceType);
+ if (componentType == null)
+ throw new IllegalStateException("Unable to map " + resourceType
+ + " to a ComponentType.");
+ return componentType.getType() + ":" + componentType.getSubtype() +
":"
+ + resourceName;
+ }
+
/**
* Returns an instantiated and loaded versions store access point.
*
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28
04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -29,24 +29,51 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.RunState;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.teiid.rhq.admin.DQPManagementView;
import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+import org.teiid.rhq.plugin.util.PluginConstants.Operation;
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
/**
*
*/
-public class PlatformComponent extends Facet implements PluginConstants {
+public class PlatformComponent extends Facet {
private final Log LOG = LogFactory.getLog(PlatformComponent.class);
+ String[] PLATFORM_SERVICES_NAMES = {
"org.teiid.jboss.deployers.RuntimeEngineDeployer",
+ "org.teiid.services.BufferServiceImpl",
"org.teiid.services.SessionServiceImpl",
"org.teiid.transport.SocketConfiguration" };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue(
+ "name", null));
+ this.resourceConfiguration = context.getPluginConfiguration();
+ super.start(context);
+ }
+
/**
* @see org.teiid.rhq.plugin.Facet#getComponentType()
* @since 7.0
@@ -94,8 +121,8 @@
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
Operation.Value.SESSION_ID).getLongValue());
} else if (name.equals(Platform.Operations.KILL_REQUEST)) {
- valueMap.put(Operation.Value.TRANSACTION_ID, configuration.getSimple(
- Operation.Value.TRANSACTION_ID).getLongValue());
+ valueMap.put(Operation.Value.TRANSACTION_ID, configuration
+ .getSimple(Operation.Value.TRANSACTION_ID).getLongValue());
} else if (name.equals(Platform.Operations.KILL_SESSION)) {
valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
Operation.Value.SESSION_ID).getLongValue());
@@ -175,7 +202,6 @@
}
}
-
@Override
public void stop() {
@@ -183,6 +209,139 @@
super.stop();
}
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.teiid.rhq.plugin.Facet#updateResourceConfiguration(org.rhq.core.pluginapi
+ * .configuration.ConfigurationUpdateReport)
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+
+ ManagementView managementView = null;
+ ComponentType componentType = new ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE);
+
+ ManagedComponent managedComponent = null;
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+
+ for (String serviceName : PLATFORM_SERVICES_NAMES) {
+
+ managedComponent = managementView.getComponent(serviceName,
+ componentType);
+ Map<String, ManagedProperty> managedProperties = managedComponent
+ .getProperties();
+
+ ProfileServiceUtil.convertConfigurationToManagedProperties(
+ managedProperties, resourceConfig, resourceContext
+ .getResourceType());
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.teiid.rhq.plugin.Facet#loadResourceConfiguration()
+ */
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ // ManagedComponent platform = null;
+ // try {
+ // platform = ProfileServiceUtil.getManagedComponent(
+ // new
+ // org.jboss.managed.api.ComponentType(PluginConstants.ComponentType.Platform.TYPE,
+ // PluginConstants.ComponentType.Platform.SUBTYPE),
+ // PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
+ // } catch (NamingException e) {
+ // final String msg = "NamingException in loadResourceConfiguration(): " +
e.getExplanation(); //$NON-NLS-1$
+ // LOG.error(msg, e);
+ // } catch (Exception e) {
+ // final String msg = "Exception in loadResourceConfiguration(): " +
e.getMessage(); //$NON-NLS-1$
+ // LOG.error(msg, e);
+ // }
+ //
+ // Get plugin config
+ Configuration c = resourceContext.getPluginConfiguration();
+
+ getProperties(c);
+
+ return c;
+
+ }
+
+ /**
+ * @param mc
+ * @param configuration
+ * @throws Exception
+ */
+ private void getProperties(Configuration configuration) {
+
+ // Get all ManagedComponents of type Teiid and subtype dqp
+ Set<ManagedComponent> mcSet = null;
+ try {
+ mcSet = ProfileServiceUtil
+ .getManagedComponents(new org.jboss.managed.api.ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE));
+ } catch (NamingException e) {
+ LOG
+ .error("NamingException getting components in Platform loadConfiguration():
"
+ + e.getMessage());
+ } catch (Exception e) {
+ LOG
+ .error("Exception getting components in Platform loadConfiguration(): "
+ + e.getMessage());
+ }
+
+ for (ManagedComponent mc : mcSet) {
+ Map<String, ManagedProperty> mcMap = mc.getProperties();
+ setProperties(mcMap, configuration);
+ }
+ }
+
+ /**
+ * @param mcMap
+ * @param configuration
+ */
+ private void setProperties(Map<String, ManagedProperty> mcMap, Configuration
configuration) {
+ for (ManagedProperty mProp : mcMap.values()) {
+ try {
+ String value = ProfileServiceUtil.stringValue(mProp.getValue());
+ PropertySimple prop = new PropertySimple(mProp.getName(), value);
+ configuration.put(prop);
+ } catch (Exception e) {
+ LOG
+ .error("Exception setting properties in Platform loadConfiguration(): "
+ + e.getMessage());
+ }
+ }
+ }
+
}
\ No newline at end of file
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
===================================================================
---
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-05-28
04:39:38 UTC (rev 2167)
+++
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -21,10 +21,7 @@
*/
package org.teiid.rhq.plugin;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -34,19 +31,8 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.plugins.ManagedComponentImpl;
-import org.jboss.managed.plugins.ManagedObjectImpl;
-import org.jboss.metatype.api.values.CollectionValueSupport;
-import org.jboss.metatype.api.values.EnumValueSupport;
-import org.jboss.metatype.api.values.GenericValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.Property;
-import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
@@ -59,7 +45,7 @@
/**
* This is the parent node for a Teiid system
*/
-public class PlatformDiscoveryComponent implements ResourceDiscoveryComponent {
+public class PlatformDiscoveryComponent implements ResourceDiscoveryComponent {
private final Log log = LogFactory.getLog(this.getClass());
@@ -77,10 +63,11 @@
Set<DiscoveredResourceDetails> discoveredResources = new
HashSet<DiscoveredResourceDetails>();
ManagedComponent mc = ProfileServiceUtil.getManagedComponent(
- new ComponentType("teiid", "dqp"),
+ new ComponentType(
+ PluginConstants.ComponentType.Platform.TEIID_TYPE,
+ PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE),
PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE);
- Configuration c = new Configuration();
/**
*
* A discovered resource must have a unique key, that must stay the same
@@ -97,91 +84,17 @@
// Config
null // Process info from a process scan
);
-
+
Configuration configuration = detail.getPluginConfiguration();
-
- getProperties(configuration);
+ configuration.put(new PropertySimple(
+ PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT, 600));
+ detail.setPluginConfiguration(configuration);
// Add to return values
discoveredResources.add(detail);
log.info("Discovered Teiid instance: " + mc.getName());
- detail.setPluginConfiguration(configuration);
return discoveredResources;
}
-
- /**
- * @param mc
- * @param configuration
- * @throws Exception
- */
- private void getProperties(Configuration configuration) {
-
- // Get all ManagedComponents of type Teiid and subtype dqp
- Set<ManagedComponent> mcSet = null;
- try {
- mcSet = ProfileServiceUtil
- .getManagedComponents(new org.jboss.managed.api.ComponentType(
- PluginConstants.ComponentType.Platform.TEIID_TYPE,
- PluginConstants.ComponentType.Platform.TEIID_SUB_TYPE));
- } catch (NamingException e) {
- log.error("NamingException getting components in PlatformDisocovery: " +
e.getMessage());
- } catch (Exception e) {
- log.error("Exception getting components in PlatformDisocovery: " +
e.getMessage());
- }
- for (ManagedComponent mc : mcSet) {
- String componentName = (String) mc.getComponentName();
- if (componentName
- .equals("RuntimeEngineDeployer")) {
- Map<String, ManagedProperty> mcMap = mc.getProperties();
- PropertyMap teiidPropertyMap = new PropertyMap("teiidProperties");
- configuration.put(teiidPropertyMap);
- configuration.put(new
PropertySimple(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT,600));
- setProperties(mcMap, teiidPropertyMap);
- } else if (componentName
- .equals("BufferService")) {
- Map<String, ManagedProperty> mcMap = mc.getProperties();
- PropertyMap bufferServicePropertyMap = new
PropertyMap("bufferServiceProperties");
- configuration.put(bufferServicePropertyMap);
- setProperties(mcMap, bufferServicePropertyMap);
- } else if (componentName
- .equals("SessionService")) {
- Map<String, ManagedProperty> mcMap = mc.getProperties();
- PropertyMap sessionServicePropertyMap = new
PropertyMap("sessionServiceProperties");
- configuration.put(sessionServicePropertyMap);
- setProperties(mcMap, sessionServicePropertyMap);
- } else if (componentName
- .equals("AuthorizationService")) {
- Map<String, ManagedProperty> mcMap = mc.getProperties();
- PropertyMap authorizationServicePropertyMap = new
PropertyMap("authorizationServiceProperties");
- configuration.put(authorizationServicePropertyMap);
- setProperties(mcMap, authorizationServicePropertyMap);
- } else if (componentName
- .equals("JdbcSocketConfiguration")) {
- Map<String, ManagedProperty> mcMap = mc.getProperties();
- PropertyMap socketConfigurationPropertyMap = new
PropertyMap("jdbcSocketConfigurationProperties");
- configuration.put(socketConfigurationPropertyMap);
- setProperties(mcMap, socketConfigurationPropertyMap);
- }
- }
- }
-
- /**
- * @param mcMap
- * @param propertyMap
- */
- private void setProperties(Map<String, ManagedProperty> mcMap,
- PropertyMap propertyMap) {
- for (ManagedProperty mProp : mcMap.values()) {
- try {
- String value = ProfileServiceUtil.stringValue(mProp.getValue());
- PropertySimple prop = new PropertySimple(mProp.getName(), value);
- propertyMap.put(prop);
- } catch (Exception e) {
- log.error("Exception setting properties in PlatformDiscovery: " +
e.getMessage());
- }
- }
- }
-
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28
04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -26,12 +26,31 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.teiid.rhq.comm.ConnectionConstants;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
/**
* Component class for the MetaMatrix Host Controller process.
@@ -48,13 +67,27 @@
String RESOURCE_NAME = "resourceName";
}
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue(
+ "name", null));
+ this.resourceConfiguration=context.getPluginConfiguration();
+ super.start(context);
+ }
+
/**
* @see org.teiid.rhq.plugin.Facet#getComponentType()
* @since 1.0
*/
@Override
String getComponentType() {
- return ConnectionConstants.ComponentType.Resource.Model.TYPE;
+ return PluginConstants.ComponentType.Translator.NAME;
}
/**
@@ -100,6 +133,81 @@
}
+ /* (non-Javadoc)
+ * @see org.teiid.rhq.plugin.Facet#loadResourceConfiguration()
+ */
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ ManagedComponent translator = null;
+ try {
+ translator = ProfileServiceUtil
+ .getManagedComponent(new ComponentType(
+ PluginConstants.ComponentType.Translator.TYPE,
+ PluginConstants.ComponentType.Translator.SUBTYPE), this.name);
+ } catch (NamingException e) {
+ final String msg = "NamingException in loadResourceConfiguration(): " +
e.getExplanation(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ } catch (Exception e) {
+ final String msg = "Exception in loadResourceConfiguration(): " +
e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ }
+
+ String translatorName = ProfileServiceUtil.getSimpleValue(
+ translator, "name", String.class);
+
+ Configuration c = resourceConfiguration;
+ PropertyList list = new PropertyList("translatorList");
+ PropertyMap propMap = null;
+ c.put(list);
+
+ // First get translator specific properties
+ ManagedProperty translatorProps = translator
+ .getProperty("translator-property");
+ getTranslatorValues(translatorProps.getValue(), propMap, list);
+
+ // Now get common properties
+ c.put(new PropertySimple("name", translatorName));
+ c.put(new PropertySimple("execution-factory-class",
+ ProfileServiceUtil.getSimpleValue(translator,
+ "execution-factory-class", String.class)));
+ c.put(new PropertySimple("immutable", ProfileServiceUtil
+ .getSimpleValue(translator, "immutable", Boolean.class)));
+ c.put(new PropertySimple("xa-capable", ProfileServiceUtil
+ .getSimpleValue(translator, "xa-capable", Boolean.class)));
+ c.put(new PropertySimple("exception-on-max-rows",
+ ProfileServiceUtil.getSimpleValue(translator,
+ "exception-on-max-rows", Boolean.class)));
+ c.put(new PropertySimple("max-result-rows", ProfileServiceUtil
+ .getSimpleValue(translator, "max-result-rows",
+ Integer.class)));
+ c.put(new PropertySimple("template-name", ProfileServiceUtil
+ .getSimpleValue(translator, "template-name",
+ String.class)));
+
+ return c;
+
+ }
+ public static <T> void getTranslatorValues(MetaValue pValue,
+ PropertyMap map, PropertyList list) {
+ MetaType metaType = pValue.getMetaType();
+ Map<String, T> unwrappedvalue = null;
+ if (metaType.isComposite()) {
+ unwrappedvalue = (Map<String, T>) MetaValueFactory
+ .getInstance().unwrap(pValue);
+ for (String key : unwrappedvalue.keySet()) {
+ map = new PropertyMap("translator-properties");
+ map.put(new PropertySimple("name", key));
+ map.put(new PropertySimple("value", unwrappedvalue.get(key)));
+ map.put(new PropertySimple("description", "Custom property"));
+ list.add(map);
+ }
+ } else {
+ throw new IllegalStateException(pValue + " is not a Composite type");
+ }
+
+ }
+
}
\ No newline at end of file
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
===================================================================
---
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28
04:39:38 UTC (rev 2167)
+++
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -65,7 +65,8 @@
for (ManagedComponent translator : translators) {
String translatorKey = translator.getName();
- String translatorName = ProfileServiceUtil.getSimpleValue(translator,
"name", String.class);
+ String translatorName = ProfileServiceUtil.getSimpleValue(
+ translator, "name", String.class);
/**
*
* A discovered resource must have a unique key, that must stay the
@@ -81,11 +82,13 @@
null // Process info from a process scan
);
- Configuration c = detail.getPluginConfiguration();
- PropertyList list = new PropertyList("translatorList");
- PropertyMap propMap = null;
- c.put(list);
+ // Get plugin config map for models
+ Configuration configuration = detail.getPluginConfiguration();
+ configuration.put(new PropertySimple("name", translatorName));
+ detail.setPluginConfiguration(configuration);
+
+ // Add to return values
// First get translator specific properties
ManagedProperty translatorProps = translator.getProperty("property");
getTranslatorValues(translatorProps.getValue(), propMap, list);
@@ -103,6 +106,7 @@
return discoveredResources;
}
+
public static <T> void getTranslatorValues(MetaValue pValue,
PropertyMap map, PropertyList list) {
MetaType metaType = pValue.getMetaType();
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-28 04:39:38
UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-28 13:31:10
UTC (rev 2168)
@@ -24,6 +24,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,19 +33,25 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.plugins.ManagedObjectImpl;
import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.CollectionValueSupport;
import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValue;
import org.jboss.metatype.api.values.GenericValueSupport;
import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -52,7 +60,6 @@
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.pluginapi.inventory.CreateResourceReport;
@@ -82,21 +89,12 @@
public void start(ResourceContext context) {
this.setComponentName(context.getPluginConfiguration().getSimpleValue(
"name", null));
- this.resourceConfiguration=context.getPluginConfiguration();
+ this.resourceConfiguration = context.getPluginConfiguration();
+ this.componentType = PluginConstants.ComponentType.VDB.NAME;
super.start(context);
}
- /*
- * (non-Javadoc)
- *
- * @see org.teiid.rhq.plugin.Facet#getComponentName()
- */
@Override
- public String getComponentName() {
- return this.name;
- }
-
- @Override
protected void setOperationArguments(String name,
Configuration configuration, Map<String, Object> valueMap) {
// Parameter logic for VDB Operations
@@ -126,8 +124,7 @@
@Override
public AvailabilityType getAvailability() {
// TODO Remove vdb version after no longer viable in Teiid
- String status = DQPManagementView.getVDBStatus(this.getComponentName(),
- 1);
+ String status = DQPManagementView.getVDBStatus(this.name, 1);
if (status.equals("ACTIVE")) {
return AvailabilityType.UP;
}
@@ -232,12 +229,113 @@
* @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
*/
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
- // this simulates the plugin taking the new configuration and
- // reconfiguring the managed resource
- resourceConfiguration = report.getConfiguration().deepCopy();
+
+ Configuration resourceConfig = report.getConfiguration();
+ resourceConfiguration = resourceConfig.deepCopy();
+
+ // First update simple properties
+ super.updateResourceConfiguration(report);
+
+ // Then update models
+ ManagementView managementView = null;
+ ComponentType componentType = new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE);
+
+ ManagedComponent managedComponent = null;
+ CollectionValueSupport modelsMetaValue = null;
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = ProfileServiceUtil.getManagementView(
+ ProfileServiceUtil.getProfileService(), true);
+ managedComponent = managementView.getComponent(this.name,
+ componentType);
+ ManagedProperty mp = managedComponent.getProperty("models");//$NON-NLS-1$
+ List<ManagedObject> modelsMp = (List<ManagedObject>) MetaValueFactory
+ .getInstance().unwrap(mp.getValue());
+ modelsMetaValue = (CollectionValueSupport) managedComponent
+ .getProperty("models").getValue();
+ GenericValue[] models = (GenericValue[]) modelsMetaValue
+ .getElements();
+ List<Property> multiSourceModelsPropertyList = resourceConfiguration
+ .getList("multiSourceModels").getList();
+ List<Property> singleSourceModelsPropertyList = resourceConfiguration
+ .getList("singleSourceModels").getList();
+ ArrayList<List<Property>> sourceMappingList = new
ArrayList<List<Property>>();
+ sourceMappingList.add(singleSourceModelsPropertyList);
+ sourceMappingList.add(multiSourceModelsPropertyList);
+ PropertyMap model = null;
+ Iterator<List<Property>> sourceMappingListIterator =
sourceMappingList.iterator();
+ while (sourceMappingListIterator.hasNext()) {
+ List<Property> sourceList = sourceMappingListIterator.next();
+ for (int i = 0; i < sourceList.size(); i++) {
+ model = (PropertyMap) sourceList.get(i);
+ String sourceName = ((PropertySimple) model
+ .get("sourceName")).getStringValue(); //$NON-NLS-1$
+ if (sourceName.equals("See below")) continue; //This is a multisource
model which we will handle separately
+ String modelName = ((PropertySimple) model.get("name")) //$NON-NLS-1$
+ .getStringValue();
+ String translatorName = ((PropertySimple) model
+ .get("translatorName")).getStringValue(); //$NON-NLS-1$
+ String dsName = ((PropertySimple) model.get("jndiName")) //$NON-NLS-1$
+ .getStringValue();
+
+ ManagedObject managedModel = null;
+ if (models != null && !modelsMp.isEmpty()) {
+ for (ManagedObject mo : modelsMp) {
+ String name = ProfileServiceUtil.getSimpleValue(mo,
+ "name", String.class); //$NON-NLS-1$
+ if (modelName.equals(name)) {
+ managedModel = mo;
+ }
+ }
+ }
+ ManagedProperty sourceMappings = managedModel
+ .getProperty("sourceMappings");//$NON-NLS-1$
+ if (sourceMappings != null) {
+ List<ManagedObject> mappings = (List<ManagedObject>) MetaValueFactory
+ .getInstance()
+ .unwrap(sourceMappings.getValue());
+ for (ManagedObject mo : mappings) {
+ String sName = ProfileServiceUtil.getSimpleValue(
+ mo, "name", String.class);//$NON-NLS-1$
+ if (sName.equals(sourceName)) {
+
+ ManagedProperty translatorProperty = mo
+ .getProperty("translatorName"); //$NON-NLS-1$
+ translatorProperty.setValue(ProfileServiceUtil
+ .wrap(SimpleMetaType.STRING,
+ translatorName));
+
+ // set the jndi name for the ds.
+ ManagedProperty jndiProperty = mo
+ .getProperty("connectionJndiName"); //$NON-NLS-1$
+ jndiProperty.setValue(ProfileServiceUtil.wrap(
+ SimpleMetaType.STRING, dsName));
+ }
+ }
+ }
+ }
+ }
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component ["
+ + managedComponent.getName() + "] of type "
+ + componentType + ".", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+
}
-
+
@Override
public Configuration loadResourceConfiguration() {
@@ -246,32 +344,42 @@
mcVdb = ProfileServiceUtil.getManagedComponent(
new org.jboss.managed.api.ComponentType(
PluginConstants.ComponentType.VDB.TYPE,
- PluginConstants.ComponentType.VDB.SUBTYPE), this
- .getComponentName());
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ this.name);
} catch (NamingException e) {
- final String msg = "NamingException in getVDBStatus(): " +
e.getExplanation(); //$NON-NLS-1$
+ final String msg = "NamingException in loadResourceConfiguration(): " +
e.getExplanation(); //$NON-NLS-1$
LOG.error(msg, e);
} catch (Exception e) {
- final String msg = "Exception in getVDBStatus(): " + e.getMessage();
//$NON-NLS-1$
+ final String msg = "Exception in loadResourceConfiguration(): " +
e.getMessage(); //$NON-NLS-1$
LOG.error(msg, e);
}
+ String vdbName = ProfileServiceUtil.getSimpleValue(mcVdb, "name",
+ String.class);
+ Integer vdbVersion = ProfileServiceUtil.getSimpleValue(mcVdb,
+ "version", Integer.class);
+ String vdbDescription = ProfileServiceUtil.getSimpleValue(mcVdb,
+ "description", String.class);
+ String vdbStatus = ProfileServiceUtil.getSimpleValue(mcVdb, "status",
+ String.class);
+ String vdbURL = ProfileServiceUtil.getSimpleValue(mcVdb, "url",
+ String.class);
+
// Get plugin config map for models
Configuration configuration = resourceContext.getPluginConfiguration();
- // configuration.put(new PropertySimple("name", vdbName));
- // configuration.put(new PropertySimple("version", vdbVersion));
- // configuration
- // .put(new PropertySimple("description", vdbDescription));
- // configuration.put(new PropertySimple("status", vdbStatus));
- // configuration.put(new PropertySimple("url", vdbURL));
+ configuration.put(new PropertySimple("name", vdbName));
+ configuration.put(new PropertySimple("version", vdbVersion));
+ configuration.put(new PropertySimple("description", vdbDescription));
+ configuration.put(new PropertySimple("status", vdbStatus));
+ configuration.put(new PropertySimple("url", vdbURL));
getModels(mcVdb, configuration);
return configuration;
}
-
+
@Override
public CreateResourceReport createResource(
CreateResourceReport createResourceReport) {
@@ -285,18 +393,20 @@
* @param configuration
* @throws Exception
*/
- private void getModels(ManagedComponent mcVdb, Configuration configuration)
- {
+ private void getModels(ManagedComponent mcVdb, Configuration configuration) {
// Get models from VDB
ManagedProperty property = mcVdb.getProperty("models");
+ List<ManagedObject> models = (List<ManagedObject>) MetaValueFactory
+ .getInstance().unwrap(property.getValue());
CollectionValueSupport valueSupport = (CollectionValueSupport) property
.getValue();
MetaValue[] metaValues = valueSupport.getElements();
- PropertyList sourceModelsList = new PropertyList("sourceModels");
+ PropertyList sourceModelsList = new PropertyList("singleSourceModels");
configuration.put(sourceModelsList);
-
- PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
+
+ PropertyList multiSourceModelsList = new PropertyList(
+ "multiSourceModels");
configuration.put(multiSourceModelsList);
PropertyList logicalModelsList = new PropertyList("logicalModels");
@@ -307,44 +417,55 @@
for (MetaValue value : metaValues) {
GenericValueSupport genValueSupport = (GenericValueSupport) value;
- ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport.getValue();
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
Boolean isSource = Boolean.TRUE;
try {
- isSource =
ProfileServiceUtil.booleanValue(managedObject.getProperty("source").getValue());
+ isSource = ProfileServiceUtil.booleanValue(managedObject
+ .getProperty("source").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
Boolean supportMultiSource = Boolean.TRUE;
try {
- supportMultiSource =
ProfileServiceUtil.booleanValue(managedObject.getProperty("supportsMultiSourceBindings").getValue());
+ supportMultiSource = ProfileServiceUtil
+ .booleanValue(managedObject.getProperty(
+ "supportsMultiSourceBindings").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
String modelName = managedObject.getName();
- ManagedProperty connectorBinding =
managedObject.getProperty("sourceMappings");
+ ManagedProperty connectorBinding = managedObject
+ .getProperty("sourceMappings");
Collection<Map<String, String>> sourceList = new
ArrayList<Map<String, String>>();
-
+
getSourceMappingValue(connectorBinding.getValue(), sourceList);
-
- String visibility = ((SimpleValueSupport)
managedObject.getProperty("visible").getValue()).getValue().toString();
- String type = ((EnumValueSupport)
managedObject.getProperty("modelType").getValue()).getValue().toString();
+ String visibility = ((SimpleValueSupport) managedObject
+ .getProperty("visible").getValue()).getValue().toString();
+ String type = ((EnumValueSupport) managedObject.getProperty(
+ "modelType").getValue()).getValue().toString();
+
// Get any model errors/warnings
MetaValue errors = managedObject.getProperty("errors").getValue();
if (errors != null) {
CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
MetaValue[] errorArray = errorValueSupport.getElements();
-
+
for (MetaValue error : errorArray) {
GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
-
- ManagedObject errorMo = (ManagedObject) errorGenValueSupport.getValue();
- String severity = ((SimpleValue)
errorMo.getProperty("severity").getValue()).getValue().toString();
- String message = ((SimpleValue)
errorMo.getProperty("value").getValue()).getValue().toString();
-
+
+ ManagedObject errorMo = (ManagedObject) errorGenValueSupport
+ .getValue();
+ String severity = ((SimpleValue) errorMo.getProperty(
+ "severity").getValue()).getValue().toString();
+ String message = ((SimpleValue) errorMo
+ .getProperty("value").getValue()).getValue()
+ .toString();
+
PropertyMap errorMap = new PropertyMap("errorMap",
new PropertySimple("severity", severity),
new PropertySimple("message", message));
@@ -357,42 +478,43 @@
if (isSource) {
String sourceName = (String) sourceMap.get("name");
String jndiName = (String) sourceMap.get("jndiName");
- String translatorName = (String) sourceMap.get("translatorName");
+ String translatorName = (String) sourceMap
+ .get("translatorName");
PropertyMap multiSourceModel = null;
- PropertyMap model = null;
- if (supportMultiSource){
- //TODO need to loop through multisource models
- multiSourceModel = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", sourceName),
- new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName));
-
- multiSourceModelsList.add(multiSourceModel);
-
- model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", "See below"),
- new PropertySimple("jndiName", "See below"),
- new PropertySimple("translatorName", "See below"),
- new PropertySimple("visibility", visibility),
- new PropertySimple("supportsMultiSource",
- true));
- sourceModelsList.add(model);
- }else{
- model = new PropertyMap("model",
+ PropertyMap model = null;
+ if (supportMultiSource) {
+ // TODO need to loop through multisource models
+ multiSourceModel = new PropertyMap("map",
new PropertySimple("name", modelName),
new PropertySimple("sourceName", sourceName),
new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName),
+ new PropertySimple("translatorName",
+ translatorName));
+
+ multiSourceModelsList.add(multiSourceModel);
+
+ model = new PropertyMap("map", new PropertySimple(
+ "name", modelName), new PropertySimple(
+ "sourceName", "See below"), new PropertySimple(
+ "jndiName", "See below"), new PropertySimple(
+ "translatorName", "See below"),
new PropertySimple("visibility", visibility),
+ new PropertySimple("supportsMultiSource", true));
+ sourceModelsList.add(model);
+ } else {
+ model = new PropertyMap("map", new PropertySimple(
+ "name", modelName), new PropertySimple(
+ "sourceName", sourceName), new PropertySimple(
+ "jndiName", jndiName), new PropertySimple(
+ "translatorName", translatorName),
+ new PropertySimple("visibility", visibility),
new PropertySimple("supportsMultiSource",
supportMultiSource));
- sourceModelsList.add(model);
+ sourceModelsList.add(model);
}
} else {
- PropertyMap model = new PropertyMap("model",
+ PropertyMap model = new PropertyMap("map",
new PropertySimple("name", modelName),
new PropertySimple("type", type),
new PropertySimple("visibility", visibility));
@@ -419,14 +541,17 @@
GenericValueSupport genValue = ((GenericValueSupport) value);
ManagedObject mo = (ManagedObject) genValue.getValue();
String sourceName = mo.getName();
- String jndi = ((SimpleValue)
mo.getProperty("connectionJndiName").getValue()).getValue().toString();
- String translatorName = ((SimpleValue)
mo.getProperty("translatorName").getValue()).getValue().toString();
+ String jndi = ((SimpleValue) mo.getProperty(
+ "connectionJndiName").getValue()).getValue().toString();
+ String translatorName = ((SimpleValue) mo.getProperty(
+ "translatorName").getValue()).getValue().toString();
map.put("name", sourceName);
map.put("jndiName", jndi);
map.put("translatorName", translatorName);
}
} else {
- throw new IllegalStateException(pValue+ " is not a Collection type");
+ throw new IllegalStateException(pValue
+ + " is not a Collection type");
}
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-05-28
04:39:38 UTC (rev 2167)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -116,10 +116,6 @@
configuration.put(new PropertySimple("status", vdbStatus));
configuration.put(new PropertySimple("url", vdbURL));
- getModels(mcVdb, configuration);
-
- // getProperties(mcVdb, configuration);
-
detail.setPluginConfiguration(configuration);
// Add to return values
@@ -129,170 +125,6 @@
return discoveredResources;
}
-
- /**
- * @param mcVdb
- * @param configuration
- * @throws Exception
- */
- private void getModels(ManagedComponent mcVdb, Configuration configuration)
- throws Exception {
- // Get models from VDB
- ManagedProperty property = mcVdb.getProperty("models");
- CollectionValueSupport valueSupport = (CollectionValueSupport) property
- .getValue();
- MetaValue[] metaValues = valueSupport.getElements();
-
- PropertyList sourceModelsList = new PropertyList("sourceModels");
- configuration.put(sourceModelsList);
-
- PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
- configuration.put(multiSourceModelsList);
-
- PropertyList logicalModelsList = new PropertyList("logicalModels");
- configuration.put(logicalModelsList);
-
- PropertyList errorList = new PropertyList("errorList");
- configuration.put(errorList);
-
- for (MetaValue value : metaValues) {
- GenericValueSupport genValueSupport = (GenericValueSupport) value;
- ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
- .getValue();
-
- Boolean isSource = Boolean.TRUE;
- try {
- isSource = ProfileServiceUtil.booleanValue(managedObject
- .getProperty("source").getValue());
- } catch (Exception e) {
- throw e;
- }
-
- Boolean supportMultiSource = Boolean.TRUE;
- try {
- supportMultiSource =
ProfileServiceUtil.booleanValue(managedObject.getProperty("supportsMultiSourceBindings").getValue());
- } catch (Exception e) {
- throw e;
- }
-
- String modelName = managedObject.getName();
- ManagedProperty connectorBinding =
managedObject.getProperty("sourceMappings");
- Collection<Map<String, String>> sourceList = new
ArrayList<Map<String, String>>();
- getSourceMappingValue(connectorBinding.getValue(), sourceList);
- String visibility = ((SimpleValueSupport)
managedObject.getProperty("visible").getValue()).getValue().toString();
- String type = ((EnumValueSupport)
managedObject.getProperty("modelType").getValue()).getValue().toString();
-
- // Get any model errors/warnings
- MetaValue errors = managedObject.getProperty("errors").getValue();
- if (errors != null) {
- CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
- MetaValue[] errorArray = errorValueSupport.getElements();
- for (MetaValue error : errorArray) {
- GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
- ManagedObject errorMo = (ManagedObject) errorGenValueSupport.getValue();
- String severity = ((SimpleValue)
errorMo.getProperty("severity").getValue()).getValue().toString();
- String message = ((SimpleValue)
errorMo.getProperty("value").getValue()).getValue().toString();
- PropertyMap errorMap = new PropertyMap("errorMap",
- new PropertySimple("severity", severity),
- new PropertySimple("message", message));
- errorList.add(errorMap);
- }
- }
-
- for (Map<String, String> sourceMap : sourceList) {
-
- if (isSource) {
- String sourceName = sourceMap.get("name");
- String jndiName = sourceMap.get("jndiName");
- String translatorName = sourceMap.get("translatorName");
-
- PropertyMap model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", sourceName),
- new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName),
- new PropertySimple("visibility", visibility),
- new PropertySimple("supportsMultiSource",supportMultiSource));
-
- model.getSimple("jndiName").setOverride(false);
- sourceModelsList.add(model);
- } else {
- PropertyMap model = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("type", type),
- new PropertySimple("visibility", visibility));
-
- logicalModelsList.add(model);
- }
- }
- }
- }
-
- /**
- * @param <T>
- * @param pValue
- * @param list
- */
- public static <T> void getSourceMappingValue(MetaValue pValue,
- Collection<Map<String, String>> list) {
- Map<String, String> map = new HashMap<String, String>();
- list.add(map);
- MetaType metaType = pValue.getMetaType();
- if (metaType.isCollection()) {
- for (MetaValue value : ((CollectionValueSupport) pValue)
- .getElements()) {
- GenericValueSupport genValue = ((GenericValueSupport) value);
- ManagedObject mo = (ManagedObject) genValue.getValue();
- String sourceName = mo.getName();
- String jndi = ((SimpleValue)
mo.getProperty("connectionJndiName").getValue()).getValue().toString();
- String translatorName = ((SimpleValue)
mo.getProperty("translatorName").getValue()).getValue().toString();
- map.put("name", sourceName);
- map.put("jndiName", jndi);
- map.put("translatorName", translatorName);
- }
- } else {
- throw new IllegalStateException(pValue+ " is not a Collection type");
- }
- }
-
- /**
- * @param mc
- * @param configuration
- * @throws Exception
- */
- private void getProperties(ManagedComponent mcVdb,
- Configuration configuration) {
-
- ManagedProperty mp = mcVdb.getProperty("JAXBProperties");
- Collection<Object> list = new ArrayList<Object>();
- getRequestCollectionValue(mp.getValue(), list);
- PropertyMap vdbPropertyMap = new PropertyMap("vdbProperties");
- configuration.put(vdbPropertyMap);
- setProperties(mp, vdbPropertyMap);
-
- }
-
- /**
- * @param mcMap
- * @param propertyMap
- */
- private void setProperties(ManagedProperty mProp, PropertyMap propertyMap) {
- //String value = ProfileServiceUtil.stringValue(mProp.getValue());
- PropertySimple prop = new PropertySimple(mProp.getName(), "test");
- propertyMap.put(prop);
-
- }
- public static <T> void getRequestCollectionValue(MetaValue pValue,
- Collection<Object> list) {
- MetaType metaType = pValue.getMetaType();
- if (metaType.isCollection()) {
- for (MetaValue value : ((CollectionValueSupport) pValue)
- .getElements()) {
- SimpleValueSupport property = (SimpleValueSupport)value;
- list.add(property);
- }
- }
- }
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java
===================================================================
---
trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java 2010-05-28
04:39:38 UTC (rev 2167)
+++
trunk/console/src/main/java/org/teiid/rhq/plugin/util/ProfileServiceUtil.java 2010-05-28
13:31:10 UTC (rev 2168)
@@ -24,11 +24,14 @@
import java.io.File;
import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
@@ -42,6 +45,7 @@
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedCommon;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedProperty;
@@ -52,6 +56,7 @@
import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.profileservice.spi.ProfileService;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
@@ -70,7 +75,6 @@
import org.teiid.rhq.plugin.adapter.api.PropertyAdapterFactory;
import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
public class ProfileServiceUtil {
@@ -305,6 +309,23 @@
}
return null;
}
+
+ public static <T> T getSimpleValue(ManagedCommon mc, String prop, Class<T>
expectedType) {
+ ManagedProperty mp = mc.getProperty(prop);
+ if (mp != null) {
+ MetaType metaType = mp.getMetaType();
+ if (metaType.isSimple()) {
+ SimpleValue simpleValue = (SimpleValue)mp.getValue();
+ return expectedType.cast((simpleValue != null) ? simpleValue.getValue() :
null);
+ }
+ else if (metaType.isEnum()) {
+ EnumValue enumValue = (EnumValue)mp.getValue();
+ return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
+ }
+ throw new IllegalArgumentException(prop+ " is not a simple type");
//$NON-NLS-1$
+ }
+ return null;
+ }
public static Map<String, PropertySimple> getCustomProperties(
Configuration pluginConfig) {
@@ -403,7 +424,7 @@
return;
}
- private static void populateManagedPropertyFromProperty(ManagedProperty
managedProperty,
+ public static void populateManagedPropertyFromProperty(ManagedProperty managedProperty,
PropertyDefinition propertyDefinition, Configuration configuration) {
// If the ManagedProperty defines a default value, assume it's more
// definitive than any default value that may
@@ -418,13 +439,15 @@
PropertyAdapter propertyAdapter = null;
if (metaValue != null) {
LOG.trace("Populating existing MetaValue of type "
- + metaValue.getMetaType() + " from RHQ property "
+ + metaValue.getMetaType() + " from Teiid property "
+ propertyDefinition.getName() + " with definition " + propertyDefinition
+ "...");
propertyAdapter = PropertyAdapterFactory
.getPropertyAdapter(metaValue);
+
propertyAdapter.populateMetaValueFromProperty(configuration.getSimple(propertyDefinition.getName()),
metaValue,
- propertyDefinition);
+ propertyDefinition);
+ managedProperty.setValue(metaValue);
} else {
MetaType metaType = managedProperty.getMetaType();
if (propertyAdapter == null)
@@ -434,9 +457,10 @@
+ propertyDefinition + " to MetaValue of type " + metaType
+ "...");
metaValue =
propertyAdapter.convertToMetaValue(configuration.getSimple(propertyDefinition.getName()),
- propertyDefinition, metaType);
+ propertyDefinition, metaType);
managedProperty.setValue(metaValue);
}
+
}
private static void updateDefaultValueOnPropertyDefinition(
@@ -487,7 +511,7 @@
.getPropertyDefinitions();
if (memberPropDefs.isEmpty())
throw new IllegalStateException(
- "PropertyDefinitionMap doesn't contain any member
PropertyDefinitions.");
+ "PropertyDefinitionMap doesn't contain any member
PropertyDefinitions."); //$NON-NLS-1$
// NOTE: We assume member prop defs are all of the same type, since
// for MapCompositeMetaTypes, they have to be.
PropertyDefinition mapMemberPropDef = memberPropDefs.values()
@@ -496,7 +520,7 @@
memberMetaType = new MapCompositeMetaType(mapMemberMetaType);
} else {
throw new IllegalStateException(
- "List member PropertyDefinition has unknown type: "
+ "List member PropertyDefinition has unknown type: " //$NON-NLS-1$
+ propDef.getClass().getName());
}
return memberMetaType;
@@ -530,6 +554,59 @@
memberMetaType = SimpleMetaType.resolve(memberClass.getName());
return memberMetaType;
}
+
+ public static SimpleValue wrap(MetaType type, String value) throws Exception {
+ if (type instanceof SimpleMetaType) {
+ SimpleMetaType st = (SimpleMetaType)type;
+
+ if (SimpleMetaType.BIGDECIMAL.equals(st)) {
+ return new SimpleValueSupport(st, new BigDecimal(value));
+ } else if (SimpleMetaType.BIGINTEGER.equals(st)) {
+ return new SimpleValueSupport(st, new BigInteger(value));
+ } else if (SimpleMetaType.BOOLEAN.equals(st)) {
+ return new SimpleValueSupport(st, Boolean.valueOf(value));
+ } else if (SimpleMetaType.BOOLEAN_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Boolean.valueOf(value).booleanValue());
+ } else if (SimpleMetaType.BYTE.equals(st)) {
+ return new SimpleValueSupport(st, new Byte(value.getBytes()[0]));
+ } else if (SimpleMetaType.BYTE_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, value.getBytes()[0]);
+ } else if (SimpleMetaType.CHARACTER.equals(st)) {
+ return new SimpleValueSupport(st, new Character(value.charAt(0)));
+ } else if (SimpleMetaType.CHARACTER_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st,value.charAt(0));
+ } else if (SimpleMetaType.DATE.equals(st)) {
+ try {
+ return new SimpleValueSupport(st, SimpleDateFormat.getInstance().parse(value));
+ } catch (ParseException e) {
+ throw new Exception("Failed to convert value to SimpleValue", e);
//$NON-NLS-1$
+ }
+ } else if (SimpleMetaType.DOUBLE.equals(st)) {
+ return new SimpleValueSupport(st, Double.valueOf(value));
+ } else if (SimpleMetaType.DOUBLE_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Double.parseDouble(value));
+ } else if (SimpleMetaType.FLOAT.equals(st)) {
+ return new SimpleValueSupport(st, Float.parseFloat(value));
+ } else if (SimpleMetaType.FLOAT_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Float.valueOf(value));
+ } else if (SimpleMetaType.INTEGER.equals(st)) {
+ return new SimpleValueSupport(st, Integer.valueOf(value));
+ } else if (SimpleMetaType.INTEGER_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Integer.parseInt(value));
+ } else if (SimpleMetaType.LONG.equals(st)) {
+ return new SimpleValueSupport(st, Long.valueOf(value));
+ } else if (SimpleMetaType.LONG_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Long.parseLong(value));
+ } else if (SimpleMetaType.SHORT.equals(st)) {
+ return new SimpleValueSupport(st, Short.valueOf(value));
+ } else if (SimpleMetaType.SHORT_PRIMITIVE.equals(st)) {
+ return new SimpleValueSupport(st, Short.parseShort(value));
+ } else if (SimpleMetaType.STRING.equals(st)) {
+ return new SimpleValueSupport(st,value);
+ }
+ }
+ throw new Exception("Failed to convert value to SimpleValue");
//$NON-NLS-1$
+ }
}
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 04:39:38 UTC (rev
2167)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-28 13:31:10 UTC (rev
2168)
@@ -62,722 +62,7 @@
'>
-<!ENTITY datasourceAndConnectionFactoryOperations '
- <operation name="flush" displayName="Flush"
- description="Flush the connections in the pool"/>
- <operation name="listFormattedSubPoolStatistics" displayName="List
Formatted Sub Pool Statistics"
- description="Obtain a formatted sub pool statistics report">
- <parameters>
- <c:simple-property required="false"
name="formatClassName"
-
defaultValue="org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter">
- <c:description>
- The fully qualified name of the Java class to use to format the the
sub pool statistics. The default
- is
"org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
- </c:description>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result"
type="longString">
- <c:description>
- A formatted sub pool statistics report.
- </c:description>
- </c:simple-property>
- </results>
- </operation>
-
- <operation name="listStatistics" displayName="List Statistics"
description="Obtain a statistics report">
- <results>
- <c:map-property name="result"/>
- </results>
- </operation>
-'>
-
-<!-- TODO: Use one shared XML entity for datasource and connection factory metrics.
-->
-<!ENTITY datasourceMetrics '
- <!-- Traits -->
- <metric property="poolJndiName" displayType="summary"
displayName="Pool JNDI Name"
- defaultOn="true" defaultInterval="60000"
dataType="trait" category="performance"
- description="the JNDI name of the connection pool for this
datasource"/>
-
- <!-- Numerics -->
- <metric property="availableConnectionCount"
measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the maximum number of connections that are
available"/>
-
- <metric property="connectionCount" measurementType="dynamic"
displayType="summary"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the number of connections that are currently in the
pool"/>
-
- <metric property="connectionCreatedCount"
measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the number of connections that have been created since the
datasource was last started"/>
-
- <metric property="connectionDestroyedCount"
measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the number of connections that have been destroyed since
the datasource was last started"/>
-
- <metric property="inUseConnectionCount"
measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the number of connections that are currently in
use"/>
-
- <metric property="local-transaction" displayType="summary"
- defaultOn="true" defaultInterval="60000"
dataType="trait" category="performance"/>
-
- <metric property="maxConnectionsInUseCount"
measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"
- description="the most connections that have been simultaneously in use
since this datasource was started"/>
-
- <metric property="maxSize" measurementType="dynamic"
displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-
- <metric property="minSize" measurementType="dynamic"
displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-'>
-
-<!-- NOTE: For Datasource ManagedProperty annotations, see:
-
https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
- Descriptions of datasource config props can also be culled from the following
locations:
-
https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/resources/dtd...
-
http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Ad...
-
http://www.jboss.org/community/wiki/ConfigDataSources
-
http://www.jboss.org/community/wiki/ConfigJCACommon
- -->
-
-<!ENTITY datasourceAndConnectionFactoryConnectionResourceConfigProps '
- <c:simple-property name="min-pool-size"
- displayName="Minimum Pool Size"
- type="integer"
- required="false"
- defaultValue="0">
- <c:description>
- The minimum number of connections the pool should hold. The default is 0.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="max-pool-size"
- displayName="Maximum Pool Size"
- type="integer"
- required="false"
- defaultValue="10">
- <c:description>
- The maximum number of connections the pool should hold. The default is 10.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-'>
-
-<!ENTITY datasourceConnectionResourceConfigProps '
- <c:simple-property name="jndi-name"
- displayName="JNDI Name"
- description="The global JNDI Name under which to bind the
datasource"
- type="string"/>
-
- <c:simple-property name="user-name"
- displayName="Username"
- description="The default username when creating a new
connection."
- type="string"
- activationPolicy="immediate"
- required="false"/>
-
- <c:simple-property name="password"
- displayName="Password"
- description="The default password when creating a new
connection."
- type="password"
- activationPolicy="immediate"
- required="false"/>
-'>
-
-<!ENTITY datasourceAndConnectionFactoryAdvancedResourceConfigProps '
- <c:simple-property name="allocation-retry" type="integer"
required="false"
- defaultValue="0">
- <c:description>
- The number of times that allocating a connection should be tried before
throwing an exception. The default
- is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="allocation-retry-wait-millis"
type="long" required="false" units="milliseconds"
- defaultValue="5000">
- <c:description>
- The time in milliseconds to wait between retrying to allocate a connection.
The default is 5000 (5 seconds).
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="background-validation" type="boolean"
required="false" defaultValue="false">
- <c:description>
- Specify if connections should be validated on a background thread versus
being validated
- prior to use. Background validation is meant to reduce the overall load on
the RDBMS system when validating
- a connection. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="background-validation-millis"
type="long" required="false" units="milliseconds"
- defaultValue="0">
- <c:description>
- The interval, in milliseconds, at which the ConnectionValidator will run.
Set to 0 to disable background
- validation. The default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="blocking-timeout-millis"
displayName="Blocking Timeout in Milliseconds"
- units="milliseconds" defaultValue="30000"
- type="integer" required="false">
- <c:description>
- Indicates the maximum time in milliseconds to block while waiting for a
connection before throwing
- an exception. Note that this blocks only while waiting for a permit for a
connection, and will never
- throw an exception if creating a new connection takes an inordinately long
time. The default is 30000
- (30 seconds).
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="idle-timeout-minutes" type="integer"
activationPolicy="immediate"
- displayName="Idle Timeout" units="minutes"
required="false" defaultValue="30">
- <c:description>
- The maximum time, in minutes, a connection may be idle before being closed.
The default is 30.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="isSameRM-override-value"
type="boolean" required="false">
- <c:description>
- If set, unconditionally sets the boolean return value of
javax.transaction.xa.XAResource.isSameRM(XAResource).
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="jmx-invoker-name"
required="false">
- <c:description>
- The ObjectName of the JMX Invoker MBean associated with this datasource.
- </c:description>
- </c:simple-property>
-
- <c:map-property name="metadata" required="false"
description="Metadata properties.">
- <c:simple-property required="false"
name="typeMapping">
- <c:description>
- The name of the corresponding type-mapping in
conf/standardjbosscmp-jdbc.xml.
- </c:description>
- <c:property-options>
- <c:option name="Cloudscape"
value="Cloudscape"/>
- <c:option name="DB2" value="DB2"/>
- <c:option name="DB2/400" value="DB2/400"/>
- <c:option name="Derby" value="Derby"/>
- <c:option name="Firebird" value="Firebird"/>
- <c:option name="FirstSQL/J"
value="FirstSQL/J"/>
- <c:option name="Hypersonic SQL" value="Hypersonic
SQL"/>
- <c:option name="InformixDB"
value="InformixDB"/>
- <c:option name="Ingres" value="Ingres"/>
- <c:option name="InterBase" value="InterBase"/>
- <c:option name="MaxDB" value="MaxDB"/>
- <c:option name="McKoi" value="McKoi"/>
- <c:option name="Mimer SQL" value="Mimer SQL"/>
- <c:option name="MS SQLSERVER" value="MS
SQLSERVER"/>
- <c:option name="MS SQLSERVER2000" value="MS
SQLSERVER2000"/>
- <c:option name="Oracle7" value="Oracle7"/>
- <c:option name="Oracle8" value="Oracle8"/>
- <c:option name="Oracle9i" value="Oracle9i"/>
- <c:option name="PointBase" value="PointBase"/>
- <c:option name="PostgreSQL"
value="PostgreSQL"/>
- <c:option name="PostgreSQL 7.2" value="PostgreSQL
7.2"/>
- <c:option name="PostgreSQL 8.0" value="PostgreSQL
8.0"/>
- <c:option name="SapDB" value="SapDB"/>
- <c:option name="SOLID" value="SOLID"/>
- <c:option name="Sybase" value="Sybase"/>
- </c:property-options>
- </c:simple-property>
- </c:map-property>
-
- <c:simple-property name="no-tx-separate-pools" type="boolean"
- displayName="No Tx Separate Pools"
required="false">
- <c:description>Whether or not to use separate pools. The default is
Yes.</c:description>
- <c:property-options>
- <c:option name="True" value="true"/>
- <c:option name="False" value="false"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="prefill" type="boolean"
required="false">
- <c:description>
- Whether to attempt to prefill the connection pool to the minimum number of
connections. NOTE: Only
- supporting pools (OnePool) support this feature. A warning can be found in
the logs if the pool does not
- support this. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:map-property name="security-domain" displayName="Security
Settings" required="false">
- <c:description>
- Security settings for connections in the pool.
- </c:description>
-
- <c:simple-property name="securityDeploymentType"
type="string"
- required="false" defaultValue="NONE">
- <c:description>
- Indicates whether Subject (from security domain), application-supplied
parameters
- (such as from getConnection(user, pw)), both Subject and app-supplied
parameters,
- or neither Subject nor app-supplied parameters are used to distinguish
connections
- in the pool. The default is "NONE".
- </c:description>
- <c:property-options>
- <c:option name="None" value="NONE"/>
- <c:option name="Application"
value="APPLICATION"/>
- <c:option name="Domain" value="DOMAIN"/>
- <c:option name="Domain and Application"
value="DOMAIN_AND_APPLICATION"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="domain" type="string"
- required="false">
- <c:description>
- The name of the JAAS security manager that will handle authentication
(only required if security
- deployment type is DOMAIN or DOMAIN_AND_APPLICATION). This name
correlates to the JAAS login-config.xml
- descriptor application-policy/name attribute.
- </c:description>
- </c:simple-property>
- </c:map-property>
-
- <c:simple-property name="statistics-formatter"
required="false">
- <c:description>
- The fully qualified class name of the class to use for formatting managed
connection pool statistics for
- this datasource. The class must implement the
org.jboss.resource.statistic.formatter.StatisticsFormatter.
- interface. The default is
"org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="type-mapping" displayName="Type
Mapping" required="false">
- <c:description>
- The name of the corresponding type-mapping in
conf/standardjbosscmp-jdbc.xml.
- </c:description>
- <c:property-options>
- <c:option name="Cloudscape" value="Cloudscape"/>
- <c:option name="DB2" value="DB2"/>
- <c:option name="DB2/400" value="DB2/400"/>
- <c:option name="Derby" value="Derby"/>
- <c:option name="Firebird" value="Firebird"/>
- <c:option name="FirstSQL/J" value="FirstSQL/J"/>
- <c:option name="Hypersonic SQL" value="Hypersonic
SQL"/>
- <c:option name="InformixDB" value="InformixDB"/>
- <c:option name="Ingres" value="Ingres"/>
- <c:option name="InterBase" value="InterBase"/>
- <c:option name="MaxDB" value="MaxDB"/>
- <c:option name="McKoi" value="McKoi"/>
- <c:option name="Mimer SQL" value="Mimer SQL"/>
- <c:option name="MS SQLSERVER" value="MS
SQLSERVER"/>
- <c:option name="MS SQLSERVER2000" value="MS
SQLSERVER2000"/>
- <c:option name="Oracle7" value="Oracle7"/>
- <c:option name="Oracle8" value="Oracle8"/>
- <c:option name="Oracle9i" value="Oracle9i"/>
- <c:option name="PointBase" value="PointBase"/>
- <c:option name="PostgreSQL" value="PostgreSQL"/>
- <c:option name="PostgreSQL 7.2" value="PostgreSQL
7.2"/>
- <c:option name="PostgreSQL 8.0" value="PostgreSQL
8.0"/>
- <c:option name="SapDB" value="SapDB"/>
- <c:option name="SOLID" value="SOLID"/>
- <c:option name="Sybase" value="Sybase"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="use-java-context"
- displayName="Use Java Context"
- type="boolean" defaultValue="true"
- required="false">
- <c:description>
- Indicates whether the JNDI name should be bound under the "java"
context,
- which causes the DataSource to only be accessible from within the JBossAS
VM.
- The default is Yes.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="use-strict-min" type="boolean"
required="false">
- <c:description>
- Whether idle connections below the min-pool-size should be closed. The
default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="validate-on-match" type="boolean"
required="false" defaultValue="true">
- <c:description>
- The validate-on-match element indicates whether or not connection level
validation should be done when a
- connection factory attempts to match a managed connection for a given set.
This is typically exclusive to
- the use of background validation. The default is Yes.
- </c:description>
- </c:simple-property>
-'>
-
-<!ENTITY datasourceAdvancedResourceConfigProps '
- <c:simple-property name="check-valid-connection-sql"
type="longString"
- displayName="Check Valid Connection SQL"
required="false">
- <c:description>The SQL statement to use to check the validity of a pool
connection.</c:description>
- </c:simple-property>
-
- <c:simple-property required="false"
name="connection-definition">
- <c:description>
- The connection definition inside the RAR deployment uniquely identified by
the connection factory interface,
- e.g. "javax.sql.DataSource".
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="exception-sorter-class-name"
type="string" activationPolicy="immediate"
- displayName="Exception Sorter Class Name"
required="false">
- <c:description>
- The fully qualified name of a Java class to use to check if an exception
should be broadcast.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="new-connection-sql" type="longString"
activationPolicy="immediate"
- displayName="New Connection SQL"
required="false">
- <c:description>
- An SQL statement to execute whenever a new connection is added to the pool;
this can be used to set the
- connection schema, etc.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="prepared-statement-cache-size"
type="integer"
- displayName="Prepared Statement Cache Size"
required="false" defaultValue="0">
- <c:description>
- The number of prepared statements per connection to be kept open and reused
in subsequent requests. They are
- stored in an LRU cache. Set to 0 to disable the cache. The default is 0.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="query-timeout"
- displayName="Query Timeout"
- type="integer"
- units="seconds"
- required="false">
- <c:description>
- Any configured query timeout in seconds. A value of 0 means no timeout. The
default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="rar-name" required="false">
- <c:description>
- The RAR deployment to associate with the connection manager MBean. e.g.
jms-ra.rar or
- myapplication.ear#my.rar for nested rars.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="set-tx-query-timeout"
- displayName="Set Tx Query Timeout"
- type="boolean"
- required="false"
- defaultValue="false">
- <c:description>
- Whether to set the query timeout based on the time remaining until
transaction timeout;
- any configured query timeout will be used if there is no transaction. The
default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="share-prepared-statements"
displayName="Share Prepared Statements"
- type="boolean"
- required="false" defaultValue="false">
- <c:description>
- Should prepared statements be shared? The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="stale-connection-checker-class-name"
- displayName="Stale Connection Checker Class Name"
- type="string"
- required="false">
- <c:description>
- Fully qualified name of the Java class used to check if a connection has
become stale.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="track-statements" type="string"
- displayName="Track Statements"
required="false">
- <c:description>
- Whether to check for unclosed Statements and ResultSets when connections are
returned to the pool. The
- default is "yes-no-warnings".
- </c:description>
- <c:property-options>
- <c:option name="No" value="no"/>
- <c:option name="Yes" value="yes"/>
- <c:option name="Yes, but no warnings"
value="yes-no-warnings" default="true"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="transaction-isolation"
required="false"
- description="The Transaction Isolation level. The default
setting is to use whichever isolation level is provided by default by the
database.">
- <c:property-options>
- <c:option value="TRANSACTION_READ_UNCOMMITTED" name="Read
Uncommitted"/>
- <c:option value="TRANSACTION_READ_COMMITTED"
default="true" name="Read Committed"/>
- <c:option value="TRANSACTION_REPEATABLE_READ"
name="Repeatable Read"/>
- <c:option value="TRANSACTION_SERIALIZABLE"
name="Serializable"/>
- <c:option value="TRANSACTION_NONE" name="None"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="url-delimiter" required="false">
- <c:description>
- Specifies the delimiter for URLs in connection-url for HA datasources.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="url-selector-strategy-class-name"
required="false">
- <c:description>
- The fully qualified class name of a class that implements the
- org.jboss.resource.adapter.jdbc.URLSelectorStrategy interface.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="use-try-lock" type="long"
required="false" defaultValue="0">
- <c:description>
- Any configured timeout, in milliseconds, for internal locks on the resource
adapter objects. A value of 0
- means no timeout. The default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="valid-connection-checker-class-name"
type="string"
- displayName="Valid Connection Checker Class Name"
required="false">
- <c:description>
- Fully qualified name of the Java class used to validate if a connection is
valid.
- </c:description>
- </c:simple-property>
-'>
-
-<!ENTITY nonXaDatasourceConnectionResourceConfigProps '
- <c:simple-property name="driver-class"
- displayName="JDBC Driver Class"
- description="The fully qualified name of the JDBC driver
class."
- type="string"
- activationPolicy="immediate"/>
-
- <c:simple-property name="connection-url"
- displayName="Connection URL"
- description="The JDBC driver URL string."
- type="string"
- activationPolicy="immediate"/>
-
- <c:map-property name="connection-properties" required="false"
- description="Arbitrary connection properties that should be
passed to the java.sql.Driver.connect(url, props) method."/>
-'>
-
-<!ENTITY nonXaDatasourceOracleTemplateProps '
- <c:simple-property name="driver-class"
default="oracle.jdbc.driver.OracleDriver"/>
- <c:simple-property name="connection-url"
default="jdbc:oracle:oci:@youroracle-tns-name"/>
- <c:simple-property name="exception-sorter-class-name"
-
default="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"/>
- <c:simple-property name="check-valid-connection-sql"
default="SELECT * FROM DUAL"/>
- <c:simple-property name="type-mapping"
default="oracle.jdbc.driver.OracleDriver"/>
- <c:simple-property name="use-try-lock" default="60000"/>
- <c:map-property name="metadata">
- <c:simple-property name="typeMapping"
default="Oracle9i"/>
- </c:map-property>
- <c:simple-property name="type-mapping"
default="Oracle9i"/>
-'>
-
-<!--
- See:
-
https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
-
http://www.jboss.org/community/wiki/ConfigJCACommon
- -->
-
-<!ENTITY connectionFactoryConnectionResourceConfigProps '
- <c:simple-property required="true" name="jndi-name"
displayName="JNDI Name"
- description="The global JNDI name to bind the connection
factory under."/>
-
- <c:simple-property required="true" name="rar-name"
displayName="RAR Name">
- <c:description>
- The name of the RAR file that contains the definition for the resource we
want to provide. For nested RAR
- files, the name would look like myapplication.ear#my.rar.
- </c:description>
- </c:simple-property>
-
- <c:simple-property required="true"
name="connection-definition">
- <c:description>
- The connection factory interface class. It should match the
connectionfactory-interface in the ra.xml file.
- </c:description>
- </c:simple-property>
-
-'>
-
-
-<!ENTITY connectionFactoryAdvancedResourceConfigProps '
- <c:list-property required="false" name="config-property">
- <c:description>
- Properties to supply to the ManagedConnectionFactory (MCF) MBean service
configuration.
- </c:description>
- <c:map-property name="config-property">
- <c:simple-property name="name" description="The name of the
configuration property." />
- <c:simple-property name="type" description="The type of the
configuration property.">
- <c:property-options>
- <c:option value="java.lang.String"
default="true"/>
- <c:option value="java.lang.Boolean"/>
- <c:option value="java.lang.Integer"/>
- <c:option value="java.lang.Double"/>
- <c:option value="java.lang.Byte"/>
- <c:option value="java.lang.Short"/>
- <c:option value="java.lang.Long"/>
- <c:option value="java.lang.Float"/>
- <c:option value="java.lang.Character"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="value" required="false"
description="The value of the configuration property." />
- </c:map-property>
- </c:list-property>
-'>
-
-<!ENTITY connectionFactoryMetrics '
- <!-- Traits -->
- <metric property="poolJndiName" displayType="summary"
displayName="Pool JNDI Name" defaultOn="true"
- defaultInterval="600000" dataType="trait"
category="performance"/>
-
- <!-- Numerics -->
- <metric property="availableConnectionCount"
measurementType="dynamic" displayType="summary"
- displayName="Available Connection Count" description="Number
of available connections."
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-
- <metric property="connectionCount" measurementType="dynamic"
displayType="summary"
- displayName="Connection Count" defaultOn="true"
defaultInterval="60000" dataType="measurement"
- category="performance"/>
-
- <metric property="connectionCreatedCount"
measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true"
defaultInterval="60000"
- dataType="measurement" category="performance"/>
-
- <metric property="connectionDestroyedCount"
measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true"
defaultInterval="60000"
- dataType="measurement" category="performance"/>
-
- <metric property="inUseConnectionCount"
measurementType="dynamic" displayType="detail"
- displayName="In Use Connection Count" description="Mumber of
connections currently in use."
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-
- <metric property="maxConnectionsInUseCount"
measurementType="dynamic" displayType="detail"
- displayName="Max Connections In Use Count"
description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-
- <metric property="maxSize" measurementType="dynamic"
displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-
- <metric property="minSize" measurementType="dynamic"
displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="60000"
dataType="measurement" category="performance"/>
-'>
-
-<!-- These are the operations that both Topics and Queues have. -->
-<!ENTITY destinationOperations '
- <operation name="removeAllMessages" displayName="Remove All
Messages" description="Remove all messages from the destination."/>
-
- <operation name="start" displayName="Start"
description="Start the destination."/>
-
- <operation name="stop" displayName="Stop"
description="Stop the destination."/>
-'>
-
-<!ENTITY deploymentResourceConfigProps '
- <c:simple-property type="boolean" required="false"
name="blackList"/>
- <c:simple-property type="boolean" required="false"
name="cache"/>
- <c:simple-property required="false" name="domain"/>
- <c:simple-property required="false" name="excluded"/>
- <c:simple-property required="false"
name="excludedExport"/>
- <c:simple-property required="false" name="exportAll">
- <c:property-options>
- <c:option name="all" value="ALL"/>
- <c:option name="non-empty" value="NON_EMPTY"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property type="boolean" required="false"
name="importAll"/>
- <c:simple-property required="false" name="included"/>
- <c:simple-property required="false" name="name"/>
- <c:simple-property required="false" name="parentDomain"/>
- <c:simple-property type="boolean" required="false"
name="parentFirst"/>
- <c:simple-property required="false" name="version"/>
-'>
-
-<!--<c:simple-property name="deployDirectory" type="string"
required="true" default="deploy"
- description="Path of the directory where the EAR
should be deployed (e.g. "deploy" or "farm") - relative to the AS
configuration set directory (e.g. /opt/jboss-5.1.0.CR1/server/default)."/>-->
-
-<!ENTITY deploymentContentConfigProps '
- <configuration>
- <c:group name="deployment" displayName="Deployment
Options">
- <c:simple-property name="deployExploded" type="boolean"
required="true" default="false"
- description="Should the archive be deployed in
exploded form (i.e. as a directory)"/>
- </c:group>
- </configuration>
-'>
-
-<!ENTITY webApplicationMetrics '
- <metric property="contextRoot"
- dataType="trait" displayType="summary"
- description="this context root of this WAR - used as a unique path
prefix for URLs corresponding to this WAR"/>
-
- <metric property="virtualHosts"
- dataType="trait" displayType="summary"
- description="the virtual hosts to which this WAR is deployed"/>
-'>
-
-<!ENTITY webApplicationContextMetrics '
- <metric property="virtualHost"
- dataType="trait" displayType="summary"
- description="the virtual host with which this context is
associated"/>
-
- <!--
- <metric property="responseTime"
- dataType="calltime" defaultOn="false"
units="milliseconds" destinationType="URL"
- description="the minimum, maximum, and average response times for
requests serviced by this webapp"/>
- -->
-
- <metric property="activeSessions"
- displayName="Currently Active Sessions"
- units="none" description="the number of sessions that are
currently active for this WAR" />
-
- <metric property="maxActive" displayName="Maximum Active
Sessions"
- units="none" description="the maximum number of sessions that
have been active for this WAR" />
-
- <metric property="sessionCounter" displayName="Created
Sessions"
- units="none" description="the number of sessions created for
this WAR"
- measurementType="trendsup" />
-
- <metric property="expiredSessions" displayName="Expired
Sessions"
- units="none" description="the number of expired sessions for
this WAR"
- measurementType="trendsup" />
-
- <metric property="rejectedSessions" displayName="Rejected
Sessions"
- units="none" description="the number of sessions rejected for
this WAR"
- measurementType="trendsup" />
-
- <metric property="sessionAverageAliveTime" displayName="Average
Session Alive Time"
- units="seconds" description="the average alive time of sessions
for this WAR" />
-
- <metric property="sessionMaxAliveTime" displayName="Max Session
Alive Time"
- units="seconds" description="the maximum alive time of sessions
for this WAR" />
-
- <metric property="Servlet.minimumResponseTime" displayName="Minimum
Response Time"
- units="milliseconds"
- description="the minimum response time for requests serviced by this
WAR"/>
-
- <metric property="Servlet.averageResponseTime" displayName="Average
Response Time"
- units="milliseconds"
- description="the average response time for requests serviced by this
WAR"/>
-
- <metric property="Servlet.maximumResponseTime" displayName="Maximum
Response Time"
- units="milliseconds"
- description="the maximum response time for requests serviced by this
WAR"/>
-
- <metric property="Servlet.totalResponseTime" displayName="Total
Response Time"
- units="milliseconds" measurementType="trendsup"
- description="the total response time for requests serviced by this
WAR"/>
-
- <metric property="Servlet.requestCount" displayName="Number of
Requests Serviced"
- units="none" description="the number of requests serviced by
this WAR"
- measurementType="trendsup" displayType="summary"/>
-
- <metric property="Servlet.errorCount" displayName="Number of Error
Responses"
- units="none" description="the number of error responses sent by
this WAR"
- measurementType="trendsup" displayType="summary"/>
-'>
-
]>
<!--
@@ -981,132 +266,111 @@
</c:constraint>
</c:simple-property>
</c:group>
- <c:group name="teiidProperties" displayName="Teiid Properties"
+ <c:group name="teiidProperties" displayName="Runtime Engine
Properties"
hiddenByDefault="false">
- <c:map-property name="teiidProperties" displayName="Runtime Engine
Properties"
- description="Properties for use by the Teiid engine">
- <c:simple-property name="state" displayName="State"
- description="State of this Teiid instance" required="false"
- readOnly="true" />
- <c:simple-property name="resultSetCacheMaxEntries"
- displayName="Result Set Cache Max Entries"
- description="The maximum number of result set cache entries. 0 indicates no
limit. (default 1024)"
- required="false" readOnly="true" />
- <c:simple-property name="maxRowsFetchSize"
- displayName="Max Rows Fetch Size"
- description="The maximum number of result set cache entries. 0 indicates no
limit. (default 1024)"
- required="false" readOnly="true" />
- <c:simple-property name="codeTablesMaxRows"
- displayName="Code Tables Max Rows"
- description="Maximum number of records in all lookup tables (default
200000)"
- required="false" readOnly="true" />
- <c:simple-property name="processName"
- displayName="Process Name" description="Name that uniquely
identifies this process"
- required="false" readOnly="true" />
- <c:simple-property name="preparedPlanCacheMaxCount"
- displayName="Prepared Plan Cache Max Count"
- description="The maximum number of query plans that are cached. Note: this is
a memory based cache. (default 250)"
- required="false" readOnly="true" />
- <c:simple-property name="maxThreads" displayName="Max
Threads"
- description="Process pool maximum thread count. (default 16) Increase this
value if your load includes a large number of XQueries or if the system's available
processors is larger than 8"
- required="false" readOnly="true" />
- <c:simple-property name="timeSliceInMilli"
- displayName="Time Slice In Milliseconds"
- description="Query processor time slice, in milliseconds. (default
2000)"
- required="false" readOnly="true" />
- <c:simple-property name="processDebugAllowed"
- displayName="Process Debug Allowed" description="True if process
debug allowed"
- required="false" readOnly="true" />
- <c:simple-property name="lobChunkSizeInKB"
- displayName="Lob Chunk Size In KB"
- description="The max lob chunk size in KB transferred each time when
processing blobs, clobs(100KB default)"
- required="false" readOnly="true" />
- <c:simple-property name="codeTablesMaxCount"
- displayName="Code Tables Max Count"
- description="The max lob chunk size in KB transferred each time when
processing blobs, clobs(100KB default)"
- required="false" readOnly="true" />
- <c:simple-property name="resultSetCacheEnabled"
- displayName="Result Set Cache Enabled"
- description="Denotes whether or not result set caching is enabled. (default
true)"
- required="false" readOnly="true" type="boolean"
/>
- <c:simple-property name="codeTablesMaxRowsPerTable"
- displayName="Code Tables Max Rows Per Table"
- description="Maximum number of records in all lookup tables (default
200000)"
- required="false" readOnly="true" />
- <c:simple-property name="activeSessionsCount"
- displayName="Active Session Count" description="Count of active
sessions"
- required="false" readOnly="true" />
- </c:map-property>
- <c:map-property name="bufferServiceProperties"
- displayName="Buffer Service Properties" description="Properties for
use by the Buffer Service">
- <c:simple-property name="state" displayName="State"
- description="State of this bean instance" required="false"
- readOnly="true" />
- <c:simple-property name="processorBatchSize"
- displayName="Processor Batch Size"
- description="The max row count of a batch sent internally within the query
processor. Should be <= the connectorBatchSize. (default 256)"
- required="false" readOnly="true" />
- <c:simple-property name="connectorBatchSize"
- displayName="Connector Batch Size"
- description="The max row count of a batch from a connector. Should be even
multiple of processorBatchSize. (default 512)"
- required="false" readOnly="true" />
- <c:simple-property name="maxProcessingBatchesColumns"
- displayName="Max Processing Batches Columns"
- description="The number of batch columns guarenteed to a processing operation.
Set this value lower if the workload typically processes larger numbers of concurrent
queries with large intermediate results from operations such as sorting, grouping, etc.
(default 128)"
- required="false" readOnly="true" />
- <c:simple-property name="maxFileSize"
- displayName="Max File Size" description="Max file size for buffer
files (default 2GB)"
- required="false" readOnly="true" />
- <c:simple-property name="maxReserveBatchColumns"
- displayName="Max Reserve Batch Columns"
- description="The number of batch columns to allow in memory (default 16384).
This value should be set lower or higher depending on the available memory to Teiid in the
VM. 16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1
gig heap."
- required="false" readOnly="true" />
- </c:map-property>
- <c:map-property name="authorizationServiceProperties"
- displayName="Authorization Service Properties"
description="Properties for use by the Authorization Service">
- <c:simple-property name="state" displayName="State"
- description="State of this bean instance" required="false"
- readOnly="true" />
- </c:map-property>
- <c:map-property name="jdbcSocketConfigurationProperties"
- displayName="Jdbc Socket Configuration Properties"
description="Properties for use by the Jdbc Socket Configuration">
- <c:simple-property name="state" displayName="State"
- description="State of this bean instance" required="false"
- readOnly="true" />
- <c:simple-property name="portNumber" displayName="Port
Number"
- description="Port Number" required="false"
readOnly="true" />
- <c:simple-property name="enabled" displayName=" SSL Enabled"
- description="SSL enabled" required="false"
readOnly="true" type="boolean"
- default="true" />
- <c:simple-property name="hostName" displayName="Host Name"
- description="Host Name" required="false"
readOnly="true" />
- <c:simple-property name="maxSocketThreads"
- displayName="Max Socket Threads" description="Max NIO threads"
- required="false" readOnly="true" />
- <c:simple-property name="inputBufferSize"
- displayName="Input Buffer Size"
- description="SO_RCVBUF size, 0 indicates that system default should be used
(default 0)"
- required="false" readOnly="true" />
- <c:simple-property name="outputBufferSize"
- displayName="Output Buffer Size"
- description="SO_SNDBUF size, 0 indicates that system default should be used
(default 0)"
- required="false" readOnly="true" />
- </c:map-property>
- <c:map-property name="sessionServiceProperties"
- displayName="Session Service Properties" description="Properties for
use by the Session Service">
- <c:simple-property name="state" displayName="State"
- description="State of this bean instance" required="false"
- readOnly="true" />
- <c:simple-property name="sessionExpirationTimeLimit"
- displayName="Session Expiration Time Limit"
- description="Max allowed time before the session is terminated by the system,
0 indicates unlimited (default 0)"
- required="false" readOnly="true" />
- <c:simple-property name="sessionMaxLimit"
- displayName="Session Max Limit"
- description="Maximum number of sessions allowed by the system (default
5000)"
- required="false" readOnly="true" />
- </c:map-property>
+ <c:simple-property name="resultSetCacheMaxEntries"
+ displayName="Result Set Cache Max Entries"
+ description="The maximum number of result set cache entries. 0 indicates no
limit. (default 1024)"
+ required="false" readOnly="false" />
+ <c:simple-property name="maxRowsFetchSize"
+ displayName="Max Rows Fetch Size"
+ description="The maximum number of result set cache entries. 0 indicates no
limit. (default 1024)"
+ required="false" readOnly="false" />
+ <c:simple-property name="codeTablesMaxRows"
+ displayName="Code Tables Max Rows"
+ description="Maximum number of records in all lookup tables (default
200000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="processName" displayName="Process
Name"
+ description="Name that uniquely identifies this process"
required="false"
+ readOnly="false" />
+ <c:simple-property name="preparedPlanCacheMaxCount"
+ displayName="Prepared Plan Cache Max Count"
+ description="The maximum number of query plans that are cached. Note: this is a
memory based cache. (default 250)"
+ required="false" readOnly="false" />
+ <c:simple-property name="maxThreads" displayName="Max
Threads"
+ description="Process pool maximum thread count. (default 16) Increase this
value if your load includes a large number of XQueries or if the system's available
processors is larger than 8"
+ required="false" readOnly="false" />
+ <c:simple-property name="timeSliceInMilli"
+ displayName="Time Slice In Milliseconds"
+ description="Query processor time slice, in milliseconds. (default 2000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="processDebugAllowed"
+ displayName="Process Debug Allowed" description="True if process
debug allowed"
+ required="false" readOnly="false" />
+ <c:simple-property name="lobChunkSizeInKB"
+ displayName="Lob Chunk Size In KB"
+ description="The max lob chunk size in KB transferred each time when processing
blobs, clobs(100KB default)"
+ required="false" readOnly="false" />
+ <c:simple-property name="codeTablesMaxCount"
+ displayName="Code Tables Max Count"
+ description="The max lob chunk size in KB transferred each time when processing
blobs, clobs(100KB default)"
+ required="false" readOnly="false" />
+ <c:simple-property name="resultSetCacheEnabled"
+ displayName="Result Set Cache Enabled"
+ description="Denotes whether or not result set caching is enabled. (default
true)"
+ required="false" readOnly="false" type="boolean"
/>
+ <c:simple-property name="codeTablesMaxRowsPerTable"
+ displayName="Code Tables Max Rows Per Table"
+ description="Maximum number of records in all lookup tables (default
200000)"
+ required="false" readOnly="false" />
+ <c:simple-property name="activeSessionsCount"
+ displayName="Active Session Count" description="Count of active
sessions"
+ required="false" readOnly="false" />
</c:group>
+ <c:group name="bufferServiceProperties" displayName="Buffer Service
Properties"
+ hiddenByDefault="false">
+ <c:simple-property name="processorBatchSize"
+ displayName="Processor Batch Size"
+ description="The max row count of a batch sent internally within the query
processor. Should be <= the connectorBatchSize. (default 256)"
+ required="false" readOnly="false" />
+ <c:simple-property name="connectorBatchSize"
+ displayName="Connector Batch Size"
+ description="The max row count of a batch from a connector. Should be even
multiple of processorBatchSize. (default 512)"
+ required="false" readOnly="false" />
+ <c:simple-property name="maxProcessingBatchesColumns"
+ displayName="Max Processing Batches Columns"
+ description="The number of batch columns guarenteed to a processing operation.
Set this value lower if the workload typically processes larger numbers of concurrent
queries with large intermediate results from operations such as sorting, grouping, etc.
(default 128)"
+ required="false" readOnly="false" />
+ <c:simple-property name="maxFileSize" displayName="Max File
Size"
+ description="Max file size for buffer files (default 2GB)"
+ required="false" readOnly="false" />
+ <c:simple-property name="maxReserveBatchColumns"
+ displayName="Max Reserve Batch Columns"
+ description="The number of batch columns to allow in memory (default 16384).
This value should be set lower or higher depending on the available memory to Teiid in the
VM. 16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1
gig heap."
+ required="false" readOnly="false" />
+ </c:group>
+ <c:group name="jdbcSocketConfigurationProperties"
+ displayName="Jdbc Socket Configuration Properties"
hiddenByDefault="false">
+ <c:simple-property name="portNumber" displayName="Port
Number"
+ description="Port Number" required="false"
readOnly="false" />
+ <c:simple-property name="enabled" displayName=" SSL Enabled"
+ description="SSL enabled" required="false"
readOnly="false" type="boolean"
+ default="true" />
+ <c:simple-property name="hostName" displayName="Host Name"
+ description="Host Name" required="false"
readOnly="false" />
+ <c:simple-property name="maxSocketThreads"
+ displayName="Max Socket Threads" description="Max NIO threads"
+ required="false" readOnly="false" />
+ <c:simple-property name="inputBufferSize"
+ displayName="Input Buffer Size"
+ description="SO_RCVBUF size, 0 indicates that system default should be used
(default 0)"
+ required="false" readOnly="false" />
+ <c:simple-property name="outputBufferSize"
+ displayName="Output Buffer Size"
+ description="SO_SNDBUF size, 0 indicates that system default should be used
(default 0)"
+ required="false" readOnly="false" />
+ </c:group>
+ <c:group name="sessionServiceProperties" displayName="Session
Service Properties"
+ hiddenByDefault="false">
+ <c:simple-property name="sessionExpirationTimeLimit"
+ displayName="Session Expiration Time Limit"
+ description="Max allowed time before the session is terminated by the system, 0
indicates unlimited (default 0)"
+ required="false" readOnly="false" />
+ <c:simple-property name="sessionMaxLimit"
+ displayName="Session Max Limit"
+ description="Maximum number of sessions allowed by the system (default
5000)"
+ required="false" readOnly="false" />
+ </c:group>
</resource-configuration>
<service name="Virtual Database (VDB)s" description="Teiid Data
Services Virtual Databases"
@@ -1194,11 +458,13 @@
<c:group name="general" displayName="General"
hiddenByDefault="false">
<c:simple-property name="name" type="string"
- description="The Virtual Database Name" required="false" />
+ description="The Virtual Database Name" required="false"
readOnly="true" />
<c:simple-property name="version" type="string"
- description="The Virtual Database Version" required="false"
/>
+ description="The Virtual Database Version" required="false"
+ readOnly="true" />
<c:simple-property name="description" type="string"
- description="The Virtual Database Description" required="false"
/>
+ description="The Virtual Database Description"
required="false"
+ readOnly="true" />
<c:simple-property name="status" type="string"
description="The Virtual Database Status" required="false"
summary="true">
@@ -1208,12 +474,12 @@
</c:property-options>
</c:simple-property>
<c:simple-property name="url" type="string"
- description="The Virtual Database URL" required="false" />
+ description="The Virtual Database URL" required="false"
readOnly="true" />
</c:group>
<c:group name="Models" displayName="Models"
hiddenByDefault="false">
- <c:list-property name="sourceModels" readOnly="true"
+ <c:list-property name="singleSourceModels" readOnly="true"
description="The source models for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map" description="Properties for this
model">
<c:simple-property name="name" displayName="Name"
description="Name of the model" required="true"
readOnly="true" />
<c:simple-property name="sourceName"
@@ -1226,38 +492,40 @@
description="JNDI name for this connection" required="false"
/>
<c:simple-property name="visibility"
displayName="Visible" description="Visibility of the model"
- required="true" type="boolean">
+ required="true" type="boolean" readOnly="true">
</c:simple-property>
<c:simple-property name="supportsMultiSource"
displayName="Supports Multi-source?"
description="Determines if this model supports multi-source bindings"
- required="true" default="true" type="boolean"
/>
+ required="true" default="true" type="boolean"
readOnly="true"/>
</c:map-property>
</c:list-property>
- <c:list-property name="multisourceModels"
+ <c:list-property name="multiSourceModels"
description="The multi-source model sources for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map" readOnly="false">
<c:simple-property name="name" displayName="Name"
- description="Name of the model" required="true" />
+ description="Name of the model" required="true"
readOnly="true" />
<c:simple-property name="sourceName"
- displayName="Source Name" description="Source name for this
model" />
- <c:simple-property name="jndiName"
- displayName="Connector Binding JNDI Name" description="JNDI name
for this connector binding"
- required="false" />
+ displayName="Source Name" description="Source name for this
model" readOnly="true"/>
+ <c:simple-property name="translatorName"
+ displayName="Translator Name" description="Name of the
translator"
+ required="true" />
+ <c:simple-property name="jndiName" displayName="Connection JNDI
Name"
+ description="JNDI name for this connection" required="false"
/>
</c:map-property>
</c:list-property>
<c:list-property name="logicalModels" readOnly="true"
description="The logical models for this VDB">
- <c:map-property name="model">
+ <c:map-property name="map">
<c:simple-property name="name" displayName="Name"
- description="Name of the model" required="true" />
+ description="Name of the model" required="true"
readOnly="true" />
<c:simple-property name="type" displayName="Type"
- description="type of logical model" required="true" />
+ description="type of logical model" required="true"
readOnly="true" />
<c:simple-property name="visibility"
displayName="Visible" description="Visbility of the model"
- required="true" default="true" />
+ required="true" default="true"
readOnly="true"/>
</c:map-property>
</c:list-property>
</c:group>