Examples of ProfileServiceConnectionProvider


Examples of org.jboss.adminclient.connection.ProfileServiceConnectionProvider

        int port = options.has("port") ? (Integer)options.valueOf("port") : 1099;
        String username = (String)options.valueOf("username");
        String password = (String)options.valueOf("password");
        String jnpURL = "jnp://" + host + ":" + port;

        ProfileServiceConnectionProvider connectionProvider =
                new RemoteProfileServiceConnectionProvider(jnpURL, username, password);
        ProfileServiceConnection connection = connectionProvider.connect();
        client.setConnection(connection);
        client.setHost(host);
        client.setPort(port);
        client.getPrintWriter().println("Connected.");
        return true;
View Full Code Here

Examples of org.rhq.plugins.jbossas5.connection.ProfileServiceConnectionProvider

     *
     * @return if successful, the Resource details, otherwise, null
     */
    @Nullable
    public DiscoveredResourceDetails discoverInProcessJBossAS(ResourceDiscoveryContext discoveryContext) {
        ProfileServiceConnectionProvider connectionProvider = new LocalProfileServiceConnectionProvider();
        ProfileServiceConnection connection;
        try {
            connection = connectionProvider.connect();
        } catch (Exception e) {
            // This most likely just means we're not embedded inside a JBoss 5.x or 6.x app server instance.
            log.debug("Unable to connect to in-process ProfileService.", e);
            return null;
        }
View Full Code Here

Examples of org.rhq.plugins.jbossas5.connection.ProfileServiceConnectionProvider

    private void connectToProfileService() {
        if (this.connection != null) {
            return;
        }
        // TODO: Check for a defunct connection and if found try to reconnect?
        ProfileServiceConnectionProvider connectionProvider;
        if (runningEmbedded()) {
            connectionProvider = new LocalProfileServiceConnectionProvider();
        } else {
            Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
            String namingURL = pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.NAMING_URL,
                null);
            validateNamingURL(namingURL);
            String principal = pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
                null);
            String credentials = pluginConfig.getSimpleValue(
                ApplicationServerPluginConfigurationProperties.CREDENTIALS, null);
            connectionProvider = new RemoteProfileServiceConnectionProvider(namingURL, principal, credentials);
        }
        if (Thread.interrupted()) {
            // In case we've been timed out by the component facet invoker, clear the interrupted status,
            // so that when the below call to connect() tried to make a remote call, JBoss Remoting
            // doesn't throw an InterruptedException and short circuit our attempts to reconnect.
            log.debug("Ignoring facet timeout in order to reconnect to Profile Service.");
        }
        try {
            this.connection = connectionProvider.connect();
        } catch (RuntimeException e) {
            Throwable rootCause = ExceptionUtils.getRootCause(e);
            rootCause = rootCause == null ? e : rootCause;
            if (rootCause instanceof SecurityException) {
                if (log.isDebugEnabled()) {
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.