Package org.mc4j.ems.connection.settings

Examples of org.mc4j.ems.connection.settings.ConnectionSettings


   private synchronized EmsConnection loadConnection(Configuration pluginConfig) throws Exception {
      if (this.connection == null) {
         try {
            //Configuration pluginConfig = this.resourceContext.getPluginConfiguration();

            ConnectionSettings connectionSettings = new ConnectionSettings();

            String connectionTypeDescriptorClass = pluginConfig.getSimple(JMXDiscoveryComponent.CONNECTION_TYPE)
                  .getStringValue();
            PropertySimple serverUrl = pluginConfig
                  .getSimple(JMXDiscoveryComponent.CONNECTOR_ADDRESS_CONFIG_PROPERTY);

            connectionSettings.initializeConnectionType((ConnectionTypeDescriptor) Util.getInstance(
                  connectionTypeDescriptorClass));
            // if not provided use the default serverUrl
            if (null != serverUrl) {
               connectionSettings.setServerUrl(serverUrl.getStringValue());
            }

//                connectionSettings.setPrincipal(pluginConfig.getSimpleValue(PRINCIPAL_CONFIG_PROP, null));
//                connectionSettings.setCredentials(pluginConfig.getSimpleValue(CREDENTIALS_CONFIG_PROP, null));

            if (connectionSettings.getAdvancedProperties() == null) {
               connectionSettings.setAdvancedProperties(new Properties());
            }

            ConnectionFactory connectionFactory = new ConnectionFactory();

View Full Code Here


        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(ConnectionSettings.class.getClassLoader());
        try {

            XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml.getBytes()));
            ConnectionSettings newSettings = (ConnectionSettings) dec.readObject();
            return newSettings;
        } finally{
            Thread.currentThread().setContextClassLoader(oldLoader);
        }
    }
View Full Code Here

public class LocalVMFinder {

    public static Map<Integer, LocalVirtualMachine> getManageableVirtualMachines() {

        ConnectionSettings fakeSettings = new ConnectionSettings();
        fakeSettings.setConnectionType(new LocalVMTypeDescriptor());
        ClassLoader cl = ClassLoaderFactory.getInstance().buildClassLoader(fakeSettings);

        try {
            Class clazz = Class.forName("org.mc4j.ems.impl.jmx.connection.support.providers.LocalVMProvider",false,cl);
            Method m = clazz.getMethod("getManageableVirtualMachines",(Class[])null);
View Full Code Here

        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(ConnectionSettings.class.getClassLoader());
        try {

            XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml.getBytes()));
            ConnectionSettings newSettings = (ConnectionSettings) dec.readObject();
            return newSettings;
        } finally{
            Thread.currentThread().setContextClassLoader(oldLoader);
        }
    }
View Full Code Here

public class LocalVMFinder {

    public static Map<Integer, LocalVirtualMachine> getManageableVirtualMachines() {

        ConnectionSettings fakeSettings = new ConnectionSettings();
        fakeSettings.setConnectionType(new LocalVMTypeDescriptor());
        ClassLoader cl = ClassLoaderFactory.getInstance().buildClassLoader(fakeSettings);


        try {
            Class clazz = Class.forName("org.mc4j.ems.impl.jmx.connection.support.providers.LocalVMProvider",false,cl);
View Full Code Here

        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(ConnectionSettings.class.getClassLoader());
        try {

            XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml.getBytes()));
            ConnectionSettings newSettings = (ConnectionSettings) dec.readObject();
            return newSettings;
        } finally{
            Thread.currentThread().setContextClassLoader(oldLoader);
        }
    }
View Full Code Here

TOP

Related Classes of org.mc4j.ems.connection.settings.ConnectionSettings

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.