Package org.jboss.managed.api

Examples of org.jboss.managed.api.ComponentType


    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests)
            throws Exception
    {
        Set<MeasurementScheduleRequest> remainingRequests = new LinkedHashSet();
        String webThreadPoolComponentName = getWebThreadPoolComponentName(getResourceContext().getPluginConfiguration());
        ComponentType webThreadPoolComponentType = MoreKnownComponentTypes.MBean.WebThreadPool.getType();
        ManagementView managementView = getConnection().getManagementView();
        ManagedComponent webThreadPoolComponent = managementView.getComponent(webThreadPoolComponentName,
                webThreadPoolComponentType);
        for (MeasurementScheduleRequest request : requests)
        {
View Full Code Here


    void createConfigurationBasedResource(CreateResourceReport createResourceReport, ResourceType resourceType) {
        Configuration defaultPluginConfig = getDefaultPluginConfiguration(resourceType);
        Configuration resourceConfig = createResourceReport.getResourceConfiguration();
        String componentName = getComponentName(defaultPluginConfig, resourceConfig);
        ComponentType componentType = ConversionUtils.getComponentType(resourceType);
        ManagementView managementView = this.component.getConnection().getManagementView();
        if (ManagedComponentUtils.isManagedComponent(managementView, componentName, componentType)) {
            createResourceReport.setStatus(CreateResourceStatus.FAILURE);
            createResourceReport.setErrorMessage("A " + resourceType.getName() + " named '" + componentName
                + "' already exists.");
View Full Code Here

            return null;
        }

        ManagementView managementView = connection.getManagementView();
        ManagedComponent serverConfigComponent = ManagedComponentUtils.getSingletonManagedComponent(managementView,
            new ComponentType("MCBean", "ServerConfig"));
        String serverName = (String) ManagedComponentUtils.getSimplePropertyValue(serverConfigComponent, "serverName");

        // serverHomeDir is the full path to the instance's configuration dir, e.g. "/opt/jboss-5.1.0.GA/server/default";
        // That's guaranteed to be unique among JBAS instances on the same machine, so we'll use it as the Resource key.
        String serverHomeDir = (String) ManagedComponentUtils.getSimplePropertyValue(serverConfigComponent,
View Full Code Here

    }

    private static Set<ManagedComponent> getWebRequestProcessorComponents(ManagementView managementView)
            throws Exception
    {
        ComponentType webRequestProcessorComponentType = MoreKnownComponentTypes.MBean.WebRequestProcessor.getType();
        return ManagedComponentUtils.getManagedComponents(managementView, webRequestProcessorComponentType,
                WEB_REQUEST_PROCESSOR_COMPONENT_NAMES_REGEX, new RegularExpressionNameMatcher());
    }
View Full Code Here

            .getManagementView();
        // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this
        //             method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext.
        managementView.load();

        ComponentType componentType = getComponentType(discoveryContext);
        Set<ManagedComponent> components;
        try {
            components = managementView.getComponentsForType(componentType);
        } catch (Exception e) {
            throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e);
View Full Code Here

            // This means the WAR is stopped, which means it has no contexts associated with it.
            return Collections.emptySet();
        }
        String webApplicationManagerComponentNamesRegex = WEB_APPLICATION_COMPONENT_NAMES_REGEX_TEMPLATE.replaceAll("%"
            + WebApplicationContextComponent.CONTEXT_PATH_PROPERTY + "%", contextPath);
        ComponentType webApplicationComponentType = MoreKnownComponentTypes.MBean.WebApplication.getType();
        //return managementView.getMatchingComponents(webApplicationManagerComponentNamesRegex,
        //        webApplicationComponentType, new RegularExpressionNameMatcher());
        return ManagedComponentUtils.getManagedComponents(managementView, webApplicationComponentType,
            webApplicationManagerComponentNamesRegex, new RegularExpressionNameMatcher());
View Full Code Here

    }

    private static File getServerTempDirectory(ProfileServiceConnection profileServiceConnection) {
        ManagementView managementView = profileServiceConnection.getManagementView();
        ManagedComponent serverConfigComponent = ManagedComponentUtils.getSingletonManagedComponent(managementView,
            new ComponentType("MCBean", "ServerConfig"));
        String serverTempDir = (String) ManagedComponentUtils.getSimplePropertyValue(serverConfigComponent,
            "serverTempDir");

        return new File(serverTempDir);
    }           
View Full Code Here

                //let's see if the connection corresponds to the server
                //this component represents. This is to prevent 2 servers
                //with the same JNP URL to be reported as UP when just one
                //of them can be up at a time.
                ManagedComponent serverConfig = managementView
                    .getComponentsForType(new ComponentType("MCBean", "ServerConfig")).iterator().next();

                String reportedServerHomeDirPath = (String) ((SimpleValue) serverConfig.getProperty("serverHomeDir")
                    .getValue()).getValue();

                String configuredServerHomeDirPath = resourceContext.getPluginConfiguration().getSimpleValue(
View Full Code Here

    private CreateResourceReport postCreateDatasourceOrConnectionFactory(CreateResourceReport report) {
        Configuration resourceConfiguration = report.getResourceConfiguration();
        ConfigurationDefinition resourceConfigurationDefinition = report.getResourceType()
            .getResourceConfigurationDefinition();
        ComponentType componentType = ConversionUtils.getComponentType(report.getResourceType());
        String componentName = report.getResourceKey();
        try {
            ManagementView managementView = getConnection().getManagementView();
            ManagedComponent managedComponent = managementView.getComponent(componentName, componentType);
            Map<String, ManagedProperty> managedProperties = managedComponent.getProperties();
View Full Code Here

        }
        String componentCategory = matcher.group(1);
        String componentSubType = matcher.group(2);
        String componentName = matcher.group(3);
        String propertyName = matcher.group(4);
        ComponentType componentType = new ComponentType(componentCategory, componentSubType);
        ManagedComponent component;
        if (componentName.equals("*")) {
            component = ManagedComponentUtils.getSingletonManagedComponent(managementView, componentType);
        } else {
            //component = ManagedComponentUtils.getManagedComponent(managementView, componentType, componentName);
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.ComponentType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.