Examples of ConcurrentHashMap


Examples of java.util.concurrent.ConcurrentHashMap

    /**
     * Return a string naming the threads which currently hold this lock.
     */
    protected String getCurrentLockHolderNames(File file) {
        StringBuilder sb = new StringBuilder();
        ConcurrentHashMap m = (ConcurrentHashMap) currentLockHolders.get(file);
        if (m == null) {
            return "(NULL)";
        }
        Enumeration threads = m.keys();
        while (threads.hasMoreElements()) {
            Thread t = (Thread) threads.nextElement();
            sb.append(t.toString());
            if (threads.hasMoreElements()) {
                sb.append(", ");
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        {
            // test by type lookup with the 'optional' flag set to false
            try
            {
                // guess we can safely assume that there is no producer for a ConcurrentHashMap in the system...
                ConcurrentHashMap chm = BeanProvider.getContextualReference(ConcurrentHashMap.class);
                Assert.fail("BeanProvider#getContextualReference should have blown up with a non-existing bean!");
            }
            catch(IllegalStateException ise)
            {
                // all is well, this is exactly what should happen!
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        throws AxisFault {
        super.init(cfgCtx, trpInDesc);

        // set the synchronise callback table
        if (cfgCtx.getProperty(BaseConstants.CALLBACK_TABLE) == null){
            cfgCtx.setProperty(BaseConstants.CALLBACK_TABLE, new ConcurrentHashMap());
        }
    }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        MailUtils.setupLogging(session, log, transportOut);

        // set the synchronise callback table
        if (cfgCtx.getProperty(BaseConstants.CALLBACK_TABLE) == null){
            cfgCtx.setProperty(BaseConstants.CALLBACK_TABLE, new ConcurrentHashMap());
        }
    }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey);
        if (factory != null)
            return factory;

        // reset these transient fields to empty values
        _transactional = new ConcurrentHashMap();
        _brokers = newBrokerSet();

        makeReadOnly();
        return this;
    }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        else
            bv = (BrokerValue) _conf.getValue(BrokerValue.KEY);

        if (FinalizingBrokerImpl.class.isAssignableFrom(
            bv.getTemplateBrokerType(_conf))) {
            return MapBackedSet.decorate(new ConcurrentHashMap(),
                new Object() { });
        } else {
            return new ConcurrentReferenceHashSet(
                ConcurrentReferenceHashSet.WEAK);
        }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

     */
    private void mergeParameters() {

        if (parameters != null)
            return;
        Map results = new ConcurrentHashMap();
        String names[] = context.findParameters();
        for (int i = 0; i < names.length; i++)
            results.put(names[i], context.findParameter(names[i]));
        ApplicationParameter params[] =
            context.findApplicationParameters();
        for (int i = 0; i < params.length; i++) {
            if (params[i].getOverride()) {
                if (results.get(params[i].getName()) == null)
                    results.put(params[i].getName(), params[i].getValue());
            } else {
                results.put(params[i].getName(), params[i].getValue());
            }
        }
        parameters = results;

    }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

        if (sipStack.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
            sipStack.getStackLogger().logDebug("Creating clientTransaction " + this);
            sipStack.getStackLogger().logStackTrace();
        }
        // this.startTransactionTimer();
        this.sipDialogs = new ConcurrentHashMap();
    }
View Full Code Here

Examples of java.util.concurrent.ConcurrentHashMap

                  continue;
               }
            }

            Map<String, ProtocolManager> supportedProtocols = new ConcurrentHashMap();

            String protocol = ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME, null,
                  info.getParams());

            if(protocol != null)
            {
               HornetQServerLogger.LOGGER.warnDeprecatedProtocol();
               ProtocolManager protocolManager = protocolMap.get(protocol);

               if(protocolManager == null)
               {
                  throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(protocol);
               }
               else
               {
                  supportedProtocols.put(protocol, protocolManager);
               }
            }

            String protocols = ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOLS_PROP_NAME, null,
                  info.getParams());

            if(protocols != null)
            {
               String[] actualProtocols = protocols.split(",");

               if(actualProtocols != null)
               {
                  for (String actualProtocol : actualProtocols)
                  {
                     ProtocolManager protocolManager = protocolMap.get(actualProtocol);

                     if(protocolManager == null)
                     {
                        throw HornetQMessageBundle.BUNDLE.noProtocolManagerFound(actualProtocol);
                     }
                     else
                     {
                        supportedProtocols.put(actualProtocol, protocolManager);
                     }
                  }
               }
            }

            ClusterConnection clusterConnection = lookupClusterConnection(info);

            Acceptor acceptor = factory.createAcceptor(info.getName(),
                                                       clusterConnection,
                                                       info.getParams(),
                                                       new DelegatingBufferHandler(),
                                                       this,
                                                       threadPool,
                                                       scheduledThreadPool,
                                                       supportedProtocols.isEmpty()?protocolMap:supportedProtocols);

            if(defaultInvmSecurityPrincipal != null && acceptor.isUnsecurable())
            {
               acceptor.setDefaultHornetQPrincipal(defaultInvmSecurityPrincipal);
            }
View Full Code Here

Examples of org.apache.openjpa.lib.util.concurrent.ConcurrentHashMap

        // can't have a null reference in the map, so use symbolic
        // constant as key
        Object key = loader == null ? NULL_LOADER : loader;
        Map loaderCache = (Map) _loaders.get(key);
        if (loaderCache == null) { // We don't have a cache for this loader.
            loaderCache = new ConcurrentHashMap();
            _loaders.put(key, loaderCache);
        } else // We have a cache for this loader.
            cls = (Class) loaderCache.get(clsName);
        }
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.