Package org.glassfish.resourcebase.resources.api

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


     * @param jndiName the jndi name of the resource being used to get Connection from
     *                 This resource can either be a pmf resource or a jdbc resource
     * @return poolName of the pool that this resource directly/indirectly points to
     */
    private PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo) {
        PoolInfo poolInfo= null;
        Collection<ConnectorRuntimeExtension> extensions =
                Globals.getDefaultHabitat().getAllServices(ConnectorRuntimeExtension.class);
        for(ConnectorRuntimeExtension extension : extensions) {
            poolInfo = extension.getPoolNameFromResourceJndiName(resourceInfo);
        }
View Full Code Here


     * established in the pool.
     * @param poolName
     * @throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
     */
    public boolean flushConnectionPool(String poolName) throws ConnectorRuntimeException {
        return ccPoolAdmService.flushConnectionPool(new PoolInfo(poolName));
    }
View Full Code Here

    public static PoolInfo getPoolInfo(ResourcePool resource){

        if(resource.getParent() != null && resource.getParent().getParent() instanceof Application){
            Application application = (Application)resource.getParent().getParent();
            return new PoolInfo(resource.getName(), application.getName());
        }else if(resource.getParent() != null && resource.getParent().getParent() instanceof Module){
            Module module = (Module)resource.getParent().getParent();
            Application application = (Application)module.getParent();
            return new PoolInfo(resource.getName(), application.getName(), module.getName());
        }else{
            return new PoolInfo(resource.getName());
        }
    }
View Full Code Here

     * established in the pool.
     * @param poolName
     * @throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
     */
    public boolean flushConnectionPool(String poolName) throws ConnectorRuntimeException {
        return ccPoolAdmService.flushConnectionPool(new PoolInfo(poolName));
    }
View Full Code Here

                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

                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, internalSystemAdministrator.getSubject());
                                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

    public void potentialConnLeakEvent(@ProbeParam("poolName") String poolName,
                                       @ProbeParam("appName") String appName,
                                       @ProbeParam("moduleName") String moduleName
                                       ) {
  // handle the conn leak probe event
        PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
        if(this.poolInfo.equals(poolInfo)) {
            if(logger.isLoggable(Level.FINEST)) {           
                logger.finest("Connection Leak event received - poolName = " +
                             poolName);
            }
View Full Code Here

    public void connectionTimedOutEvent(@ProbeParam("poolName") String poolName,
                                        @ProbeParam("appName") String appName,
                                        @ProbeParam("moduleName") String moduleName
                                        ) {
  // handle the conn timed out probe event
        PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
        if(this.poolInfo.equals(poolInfo)) {
            if(logger.isLoggable(Level.FINEST)) {
                logger.finest("Connection Timed-out event received - poolName = " +
                             poolName);
            }
View Full Code Here

            @ProbeParam("poolName") String poolName,
            @ProbeParam("appName") String appName,
            @ProbeParam("moduleName") String moduleName
            ) {
  // handle the num conn free decrement event
        PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
        if(this.poolInfo.equals(poolInfo)) {
            if(logger.isLoggable(Level.FINEST)) {
                logger.finest("Decrement Num Connections Free event received - poolName = " +
                             poolName);
            }
View Full Code Here

            @ProbeParam("moduleName") String moduleName,
            @ProbeParam("beingDestroyed") boolean beingDestroyed,
            @ProbeParam("steadyPoolSize") int steadyPoolSize) {
  // handle the num conn free increment event

        PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
        if(this.poolInfo.equals(poolInfo)) {
            if(logger.isLoggable(Level.FINEST)) {
                logger.finest("Increment Num Connections Free event received - poolName = " +
                             poolName);
            }
View Full Code Here

TOP

Related Classes of org.glassfish.resourcebase.resources.api.PoolInfo

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.