Package java.util.concurrent

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


        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

        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

        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

     */
    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

        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

                  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

    cs.write(createEntry(obj1));
    cs.write(createEntry(obj2));
    cs.write(createEntry(obj3));

      final ConcurrentHashMap map = new ConcurrentHashMap();
      AdvancedCacheLoader.CacheLoaderTask taskWithValues = new AdvancedCacheLoader.CacheLoaderTask() {
         @Override
         public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
            if (marshalledEntry.getKey() != null && marshalledEntry.getValue() != null) {
               map.put(marshalledEntry.getKey(), marshalledEntry.getValue());
            }
         }
      };
    cs.process(null, taskWithValues, new ThreadPoolExecutor(1, 2, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(10)), true, false);

    assertEquals(map.size(), 3);
      assertEquals(map.remove(obj1.getKey()), obj1.getValue());
      assertEquals(map.remove(obj2.getKey()), obj2.getValue());
      assertEquals(map.remove(obj3.getKey()), obj3.getValue());
    assertTrue(map.isEmpty());

      final ConcurrentHashSet set = new ConcurrentHashSet();
      AdvancedCacheLoader.CacheLoaderTask taskWithoutValues = new AdvancedCacheLoader.CacheLoaderTask() {
         @Override
         public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
            if (marshalledEntry.getKey() != null) {
               set.add(marshalledEntry.getKey());
            }
         }
      };
      cs.process(null, taskWithoutValues, new ThreadPoolExecutor(1, 2, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(10)), false, false);
      assertEquals(set.size(), 3);
      assertTrue(set.remove(obj1.getKey()));
      assertTrue(set.remove(obj2.getKey()));
      assertTrue(set.remove(obj3.getKey()));
      assertTrue(map.isEmpty());
  }
View Full Code Here

                  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(clusterConnection,
                                                       info.getParams(),
                                                       new DelegatingBufferHandler(),
                                                       this,
                                                       threadPool,
                                                       scheduledThreadPool,
                                                       supportedProtocols.isEmpty()?protocolMap:supportedProtocols);

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

                                                        .getProperty(WSDLQueryHandler.class.getName()
                                                                     + ".Schemas"));

            if (mp == null) {
                endpointInfo.getService().setProperty(WSDLQueryHandler.class.getName(),
                                                      new ConcurrentHashMap());
                mp = CastUtils.cast((Map)endpointInfo.getService()
                                    .getProperty(WSDLQueryHandler.class.getName()));
            }
            if (smp == null) {
                endpointInfo.getService().setProperty(WSDLQueryHandler.class.getName()
                                                      + ".Schemas",
                                                      new ConcurrentHashMap());
                smp = CastUtils.cast((Map)endpointInfo.getService()
                                    .getProperty(WSDLQueryHandler.class.getName()
                                                 + ".Schemas"));
            }
           
View Full Code Here

TOP

Related Classes of java.util.concurrent.ConcurrentHashMap

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.