Examples of EmsConnection


Examples of org.mc4j.ems.connection.EmsConnection

    */
   private int consecutiveConnectionErrors;


   public EmsConnection getEmsConnection(Configuration config) {
      EmsConnection emsConnection = null;

      try {
         emsConnection = loadConnection(config);
      } catch (Exception e) {
         log.error("Component attempting to access a connection that could not be loaded");
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

     * @param config Configuration properties for this connection
     * @return an EmsConnection or null in case of failure
     * @see #getEmsConnection()
     */
    public EmsConnection getEmsConnection(Configuration config) {
        EmsConnection emsConnection = null;
        configuration = config;

        try {
            emsConnection = loadConnection(config, copyConnectionLibraries, tmpDir);
        } catch (Exception e) {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

     * before via a call to {@link #getEmsConnection(Configuration)}
     * @return an EmsConnection or null in case of failure
     * @see #getEmsConnection(org.rhq.core.domain.configuration.Configuration)
     */
    public EmsConnection getEmsConnection() {
        EmsConnection emsConnection = null;
        if (configuration == null) {
            throw new RuntimeException("No configuration set");
        }

        try {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

        if (log.isInfoEnabled()) {
            log.info("Starting shutdown operation on " + CassandraNodeComponent.class.getName() +
                " with resource key " + context.getResourceKey());
        }
        EmsConnection emsConnection = getEmsConnection();
        EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
        Class[] emptyParams = new Class[0];

        if (log.isDebugEnabled()) {
            log.debug("Disabling thrift...");
        }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    public void start(ResourceContext<ProfileServiceComponent<?>> context) throws InvalidPluginConfigurationException,
        Exception {

        resourceContext = context;
        parentComponent = context.getParentResourceComponent();
        EmsConnection connection = getEmsConnection();

        beanName = context.getPluginConfiguration().getSimple(CACHE_DETAIL_BEAN_NAME).getStringValue();

        log.debug("JBoss Cache " + beanName + " was loaded.");
    }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

        return;
    }

    public AvailabilityType getAvailability() {
        try {
            EmsConnection connection = parentComponent.getEmsConnection();
            if (connection == null)
                return AvailabilityType.DOWN;

            boolean up = connection.getBean(beanName).isRegistered();
            return up ? AvailabilityType.UP : AvailabilityType.DOWN;
        } catch (Exception e) {
            if (log.isDebugEnabled())
                log.debug("Can not determine availability for " + beanName + ": " + e);
            return AvailabilityType.DOWN;
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    public ResourceContext<ProfileServiceComponent<?>> getResourceContext() {
        return resourceContext;
    }

    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
        EmsConnection connection = getEmsConnection();

        EmsBean detailComponent = connection.getBean(beanName);

        for (MeasurementScheduleRequest request : metrics) {

            String metricName = request.getName();
            try {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

      throw new InvalidPluginConfigurationException(
          "Invalid plugin configuration in JBossCache component.");

    Configuration defaultConfig = context.getDefaultPluginConfiguration();

    EmsConnection connection = parentComponent.getEmsConnection();
    Set<DiscoveredResourceDetails> resources = new HashSet<DiscoveredResourceDetails>();

    String jmxName = defaultConfig.getSimple(CACHE_JMX_NAME).getStringValue();

        beanName += ((jmxName==null || jmxName.equals("")) ? "" : "," + jmxName);

        // This is a singleton ResourceType, so we are only looking for a single MBean.
        EmsBean emsBean = connection.getBean(beanName);
        if (emsBean == null) {
            connection.refresh();
            emsBean = connection.getBean(beanName);
        }

        if (emsBean != null) {
            Configuration conf = new Configuration();
            conf.put(new PropertySimple(
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

     *
     * @param objectName the name of the bean to load
     * @return the bean that is loaded
     */
    protected EmsBean loadBean(String objectName) {
        EmsConnection emsConnection = getEmsConnection();

        if (emsConnection != null) {
            EmsBean bean = emsConnection.getBean(objectName);
            if (bean == null) {
                // In some cases, this resource component may have been discovered by some means other than querying its
                // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
                // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
                // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
                // bean before giving up.
                emsConnection.queryBeans(objectName);
                bean = emsConnection.getBean(objectName);
            }

            return bean;
        }

View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    ProfileServiceComponent parentComponent = context
        .getParentResourceComponent();

    Configuration defaultPluginConfig = context.getDefaultPluginConfiguration();

    EmsConnection connection = parentComponent.getEmsConnection();

    Set<DiscoveredResourceDetails> resources = new HashSet<DiscoveredResourceDetails>();

    Pattern pattern = Pattern.compile(REGEX);

        ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(
                defaultPluginConfig.getSimple(JBossCacheComponent.CACHE_SEARCH_STRING).getStringValue());

        List<EmsBean> cacheBeans = connection.queryBeans(queryUtility
                .getTranslatedQuery());

        HashSet<String> beanNames = new HashSet<String>();

        for (EmsBean bean : cacheBeans) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.