Examples of ConnectionProvider


Examples of org.mc4j.ems.connection.support.ConnectionProvider

            // TODO GH: Add intelligent classloader layer here that can either work
            // directly against current classloader or build a non-delegating child
            // to override with connection specific classes
            Class clazz = Class.forName(className, false, loader);

            ConnectionProvider connectionProvider = (ConnectionProvider) clazz.newInstance();

            connectionProvider.initialize(connectionSettings);
            return connectionProvider;

        } catch (IllegalAccessException e) {
            throw new ConnectionException("Could not access ConnectionClass " + className, e);
        } catch (InstantiationException e) {
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

            }

            ConnectionFactory connectionFactory = new ConnectionFactory();


            ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);
            this.connection = connectionProvider.connect();

            this.connection.loadSynchronous(false); // this loads all the MBeans

            this.consecutiveConnectionErrors = 0;
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

            // TODO GH: Add intelligent classloader layer here that can either work
            // directly against current classloader or build a non-delegating child
            // to override with connection specific classes
            Class clazz = Class.forName(className, false, loader);

            ConnectionProvider connectionProvider = (ConnectionProvider) clazz.newInstance();

            connectionProvider.initialize(connectionSettings);
            return connectionProvider;

        } catch (IllegalAccessException e) {
            throw new ConnectionException("Could not access ConnectionClass " + className, e);
        } catch (InstantiationException e) {
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

                    "jboss");

                ConnectionFactory connectionFactory = new ConnectionFactory();
                connectionFactory.discoverServerClasses(connectionSettings);

                ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);
                connection = connectionProvider.connect();

                connection.loadSynchronous(false); // this loads all the MBeans

                consecutiveConnectionErrors = 0;
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

            connectionFactory.discoverServerClasses(connectionSettings);

            LOG.info("Loading AS7 connection [" + connectionSettings.getServerUrl() + "] with install path ["
                + connectionSettings.getLibraryURI() + "]...");

            ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);
            this.connection = connectionProvider.connect();

            if (LOG.isDebugEnabled()) {
                LOG.debug("Successfully made connection to the AS7 instance for resource ["
                    + resourceContext.getResourceKey() + "]");
            }
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

                        log.debug("Loading connection [" + connectionSettings.getServerUrl()
                            + "] ignoring remote install path [" + catalinaHome + "]");
                    }
                }

                ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);
                this.connection = connectionProvider.connect();

                this.connection.loadSynchronous(false); // this loads all the MBeans

                this.consecutiveConnectionErrors = 0;
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

            connectionSettings.getAdvancedProperties().setProperty(ConnectionFactory.USE_CONTEXT_CLASSLOADER,
                String.valueOf(FALSE));

            ConnectionFactory connectionFactory = new ConnectionFactory();
            connectionFactory.discoverServerClasses(connectionSettings);
            ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);

            return connectionProvider.connect();

        } catch (Exception e) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Could not create EmsConnection", e);
            }
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

                    "jboss");

                log.info("Loading JBoss connection [" + connectionSettings.getServerUrl() + "] with install path ["
                    + connectionSettings.getLibraryURI() + "]...");

                ConnectionProvider connectionProvider = connectionFactory.getConnectionProvider(connectionSettings);
                this.connection = connectionProvider.connect();

                this.connection.loadSynchronous(false); // this loads all the MBeans

                this.consecutiveConnectionErrors = 0;
View Full Code Here

Examples of org.mc4j.ems.connection.support.ConnectionProvider

        String connectorAddress = pluginConfig.getSimpleValue(CONNECTOR_ADDRESS_CONFIG_PROPERTY, null);
        if (connectorAddress == null) {
            throw new InvalidPluginConfigurationException("A connector address must be specified when manually adding a JVM.");
        }

        ConnectionProvider connectionProvider;
        EmsConnection connection;
        try {
            connectionProvider = ConnectionProviderFactory.createConnectionProvider(pluginConfig, null,
                discoveryContext.getParentResourceContext().getTemporaryDirectory());
            connection = connectionProvider.connect();
            connection.loadSynchronous(false);
        } catch (Exception e) {
            if (e.getCause() instanceof SecurityException) {
                throw new InvalidPluginConfigurationException("Failed to authenticate to JVM with connector address ["
                        + connectorAddress + "] - principal and/or credentials connection properties are not set correctly.");
View Full Code Here

Examples of org.netbeans.modules.dbschema.jdbcimpl.ConnectionProvider

            DatabaseMetaData dmd = con.getMetaData();
            if (DBVendorTypeHelper.requireUpperCaseSchema(dmd)) {
                userSchema = dmd.getUserName().trim().toUpperCase();
            }

            ConnectionProvider cp = new ConnectionProvider(con, dmd.getDriverName().trim());
            if (userSchema != null) {
                cp.setSchema(userSchema);
            }

            OutputStream outstream = null;

            try {
                SchemaElementImpl outSchemaImpl = new SchemaElementImpl(cp);
                SchemaElement schemaElement = new SchemaElement(outSchemaImpl);
                schemaElement.setName(DBIdentifier.create(generatedSchemaName));

                if(dmd.getDatabaseProductName().compareToIgnoreCase("MYSQL") == 0)
                    outSchemaImpl.initTables(cp, new LinkedList(tables), new LinkedList(), true);
                else
                    outSchemaImpl.initTables(cp, new LinkedList(tables), new LinkedList(), false);
                outstream = new FileOutputStream(
                        new File(classout,
                        new StringBuffer(generatedSchemaName)
                            .append(DBSCHEMA_EXTENSION).toString()));

                // XXX Unfortunately, if SchemaElement.save gets an
                // IOException, it prints the stack trace but does not
                // let us handle it :-(
                schemaElement.save(outstream);

            } catch (IOException ex) {
                // Catch FileNotFound, etc.
                throw JDOCodeGeneratorHelper.createGeneratorException(
                        "CMG.CannotSaveDBSchema", bundle, ex); // NOI18N
            } finally {
                cp.closeConnection();
                try {
                    if (outstream != null) {
                        outstream.close();
                    }
                } catch (IOException ex) {
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.