corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java
author skoppar
Thu, 07 Oct 2010 00:59:40 -0700
changeset 7579 cf90ea1653fb
parent 5555 b2b5ed3f0d0d
permissions -rw-r--r--
6714797: InitialContext.close does not close NIO socket connections Reviewed-by: asaha
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
7579
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
     2
 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
package com.sun.corba.se.impl.transport;
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import java.util.Collection;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
import java.util.Iterator;
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
import com.sun.corba.se.pept.broker.Broker;
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
import com.sun.corba.se.pept.transport.Connection;
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
import com.sun.corba.se.pept.transport.ConnectionCache;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
import com.sun.corba.se.spi.logging.CORBALogDomains;
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
import com.sun.corba.se.spi.orb.ORB;
7579
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    37
import com.sun.corba.se.spi.transport.CorbaConnection;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
import com.sun.corba.se.spi.transport.CorbaConnectionCache;
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
import com.sun.corba.se.impl.orbutil.ORBUtility;
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * @author Harold Carr
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
public abstract class CorbaConnectionCacheBase
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
    implements
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
        ConnectionCache,
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
        CorbaConnectionCache
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
{
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
    protected ORB orb;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
    protected long timestamp = 0;
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
    protected String cacheType;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
    protected String monitoringName;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
    protected ORBUtilSystemException wrapper;
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
    protected CorbaConnectionCacheBase(ORB orb, String cacheType,
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
                                       String monitoringName)
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
        this.orb = orb;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
        this.cacheType = cacheType;
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
        this.monitoringName = monitoringName;
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
        wrapper =ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT);
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
        registerWithMonitoring();
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
        dprintCreation();
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
    // pept.transport.ConnectionCache
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
    public String getCacheType()
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
        return cacheType;
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
    public synchronized void stampTime(Connection c)
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
        // _REVISIT_ Need to worry about wrap around some day
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
        c.setTimeStamp(timestamp++);
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
    public long numberOfConnections()
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
        synchronized (backingStore()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
            return values().size();
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
7579
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    91
    public void close() {
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    92
        synchronized (backingStore()) {
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    93
            for (Object obj : values()) {
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    94
                ((CorbaConnection)obj).closeConnectionResources() ;
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    95
            }
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    96
        }
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    97
    }
cf90ea1653fb 6714797: InitialContext.close does not close NIO socket connections
skoppar
parents: 5555
diff changeset
    98
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
    public long numberOfIdleConnections()
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
        long count = 0;
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
        synchronized (backingStore()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
            Iterator connections = values().iterator();
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
            while (connections.hasNext()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
                if (! ((Connection)connections.next()).isBusy()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
                    count++;
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
        return count;
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
    public long numberOfBusyConnections()
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
        long count = 0;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
        synchronized (backingStore()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
            Iterator connections = values().iterator();
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
            while (connections.hasNext()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
                if (((Connection)connections.next()).isBusy()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
                    count++;
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
        return count;
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
     * Discarding least recently used Connections that are not busy
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
     * This method must be synchronized since one WorkerThread could
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
     * be reclaming connections inside the synchronized backingStore
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
     * block and a second WorkerThread (or a SelectorThread) could have
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
     * already executed the if (numberOfConnections <= .... ). As a
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
     * result the second thread would also attempt to reclaim connections.
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
     * If connection reclamation becomes a performance issue, the connection
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
     * reclamation could make its own task and consequently executed in
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
     * a separate thread.
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
     * Currently, the accept & reclaim are done in the same thread, WorkerThread
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
     * by default. It could be changed such that the SelectorThread would do
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
     * it for SocketChannels and WorkerThreads for Sockets by updating the
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
     * ParserTable.
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
    synchronized public boolean reclaim()
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
            long numberOfConnections = numberOfConnections();
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
            if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
                dprint(".reclaim->: " + numberOfConnections
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
                        + " ("
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
                        + orb.getORBData().getHighWaterMark()
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
                        + "/"
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
                        + orb.getORBData().getLowWaterMark()
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
                        + "/"
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
                        + orb.getORBData().getNumberToReclaim()
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
                        + ")");
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
            if (numberOfConnections <= orb.getORBData().getHighWaterMark() ||
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
                numberOfConnections < orb.getORBData().getLowWaterMark()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
                return false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
            Object backingStore = backingStore();
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
            synchronized (backingStore) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
                 // REVISIT - A less expensive alternative connection reclaiming
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
                 //           algorithm could be investigated.
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
                for (int i=0; i < orb.getORBData().getNumberToReclaim(); i++) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
                    Connection toClose = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
                    long lru = java.lang.Long.MAX_VALUE;
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
                    Iterator iterator = values().iterator();
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
                    // Find least recently used and not busy connection in cache
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
                    while ( iterator.hasNext() ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
                        Connection c = (Connection) iterator.next();
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
                        if ( !c.isBusy() && c.getTimeStamp() < lru ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
                            toClose = c;
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
                            lru = c.getTimeStamp();
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
                        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
                    if ( toClose == null ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
                        return false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
                    try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
                        if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
                            dprint(".reclaim: closing: " + toClose);
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
                        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
                        toClose.close();
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
                    } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
                        // REVISIT - log
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
                if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
                    dprint(".reclaim: connections reclaimed ("
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
                            + (numberOfConnections - numberOfConnections()) + ")");
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
            // XXX is necessary to do a GC to reclaim
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
            // closed network connections ??
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
            // java.lang.System.gc();
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
            return true;
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
        } finally {
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
            if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
                dprint(".reclaim<-: " + numberOfConnections());
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
    // spi.transport.ConnectionCache
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
    public String getMonitoringName()
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
        return monitoringName;
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
    // Implementation
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
    // This is public so folb.Server test can access it.
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
    public abstract Collection values();
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
    protected abstract Object backingStore();
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
    protected abstract void registerWithMonitoring();
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
    protected void dprintCreation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
        if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
            dprint(".constructor: cacheType: " + getCacheType()
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
                   + " monitoringName: " + getMonitoringName());
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
    protected void dprintStatistics()
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
        if (orb.transportDebugFlag) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
            dprint(".stats: "
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
                   + numberOfConnections() + "/total "
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
                   + numberOfBusyConnections() + "/busy "
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
                   + numberOfIdleConnections() + "/idle"
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
                   + " ("
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
                   + orb.getORBData().getHighWaterMark() + "/"
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
                   + orb.getORBData().getLowWaterMark() + "/"
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
                   + orb.getORBData().getNumberToReclaim()
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
                   + ")");
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
    protected void dprint(String msg)
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
        ORBUtility.dprint("CorbaConnectionCacheBase", msg);
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
}
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
// End of file.