Examples of PoolInfo


Examples of org.glassfish.resource.common.PoolInfo

        @HandlerInput(name = "poolName", type = String.class, required = true)})
    public static void pingJms(HandlerContext handlerCtx) {
        try {
            String poolName = (String) handlerCtx.getInputValue("poolName");
            ConnectorRuntime connectorRuntime = GuiUtil.getHabitat().getComponent(ConnectorRuntime.class);
            PoolInfo poolInfo = new PoolInfo(poolName);
            connectorRuntime.pingConnectionPool(poolInfo);
            GuiUtil.prepareAlert("success", GuiUtil.getMessage("msg.PingSucceed"), null);
        } catch (Exception ex) {
            GuiUtil.prepareAlert("error", GuiUtil.getMessage("msg.Error"), ex.getMessage());
        }
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

        }

        // do the ping
        try
        {
            PoolInfo poolInfo = new PoolInfo(poolName);
            final boolean pingable = connRuntime.pingConnectionPool(poolInfo);
            result.put(PING_SUCCEEDED_KEY, pingable);
        }
        catch (final ResourceException e)
        {
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

        }
        try
        {
            final ConnectorRuntime connRuntime = mHabitat.getComponent(ConnectorRuntime.class, null);
            //as per the method parameters, this is not applicable for "application-scoped" pools
            PoolInfo poolInfo = new PoolInfo(poolName);
            boolean flushStatus = connRuntime.flushConnectionPool(poolInfo);

            result.put(ConnectorRuntimeAPIProvider.FLUSH_CONNECTION_POOL_KEY, flushStatus);   
        }           
        catch (ConnectorRuntimeException ex)
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

        try
        {
            final ConnectorRuntime connRuntime = mHabitat.getComponent(ConnectorRuntime.class, null);
            //as per the method parameters, this is not applicable for "application-scoped" pools
            PoolInfo poolInfo = new PoolInfo(poolName);
            final Set<String> tableNames = connRuntime.getValidationTableNames(poolInfo);
            result.put(ConnectorRuntimeAPIProvider.VALIDATION_TABLE_NAMES_KEY, tableNames);
        }
        catch (ComponentException e)
        {
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

        }
        try
        {
            final ConnectorRuntime connRuntime = mHabitat.getComponent(ConnectorRuntime.class, null);
            //as per the method parameters, this is not applicable for "application-scoped" pools
            PoolInfo poolInfo = new PoolInfo(poolName);
            final boolean pingStatus = connRuntime.pingConnectionPool(poolInfo);
            result.put(ConnectorRuntimeAPIProvider.PING_CONNECTION_POOL_KEY, pingStatus);
        }
        catch (ResourceException ex)
        {
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

        if(!poolUtil.isValidPool(resources, poolName, scope, report)){
            return;
        }

        PoolInfo poolInfo = new PoolInfo(poolName, applicationName, moduleName);
        try {
            status = connRuntime.pingConnectionPool(poolInfo);
            if (status) {
                report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
            } else {
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

                            ping = Boolean.valueOf(((JdbcConnectionPool)pool).getPing());
                        }else if (pool instanceof ConnectorConnectionPool) {
                            ping = Boolean.valueOf(((ConnectorConnectionPool)pool).getPing());
                        }
                        if(ping){
                            PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(pool);
                            CommandRunner commandRunner = habitat.getComponent(CommandRunner.class);
                            ActionReport report = habitat.getComponent(ActionReport.class);
                            CommandRunner.CommandInvocation invocation =
                                    commandRunner.getCommandInvocation("ping-connection-pool", report);
                            ParameterMap params = new ParameterMap();
                            params.add("appname",poolInfo.getApplicationName());
                            params.add("modulename",poolInfo.getModuleName());
                            params.add("DEFAULT", poolInfo.getName());
                            invocation.parameters(params).execute();
                            if(report.getActionExitCode() == ActionReport.ExitCode.SUCCESS){
                                _logger.log(Level.INFO, "app-scoped.ping.connection.pool.success", poolInfo);
                            }else{
                                Object args[] = new Object[]{poolInfo, report.getFailureCause()};
View Full Code Here

Examples of org.glassfish.resource.common.PoolInfo

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }

        try {
            PoolInfo poolInfo = new PoolInfo(poolName, applicationName, moduleName);
            _runtime.flushConnectionPool(poolInfo);
            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
        } catch (ConnectorRuntimeException e) {
            report.setMessage(localStrings.getLocalString("flush.connection.pool.fail",
                    "Failed to flush connection pool {0} due to {1}.", poolName, e.getMessage()));
View Full Code Here

Examples of org.glassfish.resourcebase.resources.api.PoolInfo

        return false;
    }

    boolean pingConnectionPool(String tmpJMSResource) throws ResourceException
    {
        PoolInfo poolInfo = new PoolInfo(tmpJMSResource);
        return connectorRuntime.pingConnectionPool(poolInfo);
    }
View Full Code Here

Examples of org.glassfish.resourcebase.resources.api.PoolInfo

                if(resources.getResources() != null){
                    for(Resource resource : resources.getResources()){
                        if(resource instanceof ResourcePool){
                            ResourcePool pool = (ResourcePool)resource;
                            if(Boolean.valueOf(pool.getPing())){
                                PoolInfo poolInfo = ResourceUtil.getPoolInfo(pool);
                                CommandRunner commandRunner = commandRunnerProvider.get();
                                ActionReport report = actionReportProvider.get();
                                CommandRunner.CommandInvocation invocation =
                                        commandRunner.getCommandInvocation("ping-connection-pool", report);
                                ParameterMap params = new ParameterMap();
                                params.add("appname",poolInfo.getApplicationName());
                                params.add("modulename",poolInfo.getModuleName());
                                params.add("DEFAULT", poolInfo.getName());
                                invocation.parameters(params).execute();
                                if(report.getActionExitCode() == ActionReport.ExitCode.SUCCESS){
                                    logger.log(Level.INFO, "app-scoped.ping.connection.pool.success", poolInfo);
                                }else{
                                    Object args[] = new Object[]{poolInfo, report.getFailureCause()};
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.