Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Lock


    }


    @Override
    public WebResourceRoot getResources() {
        Lock readLock = resourcesLock.readLock();
        readLock.lock();
        try {
            return resources;
        } finally {
            readLock.unlock();
        }
    }
View Full Code Here


                    cacheValue = newCacheValue;
                }
            }
        }

        final Lock readLock = cacheValue.getLock().readLock();
        readLock.lock();
        try {
            factory = cacheValue.getExpressionFactory();
        } finally {
            readLock.unlock();
        }

        if (factory == null) {
            final Lock writeLock = cacheValue.getLock().writeLock();
            try {
                writeLock.lock();
                factory = cacheValue.getExpressionFactory();
                if (factory == null) {
                    factory = ExpressionFactory.newInstance();
                    cacheValue.setExpressionFactory(factory);
                }
            } finally {
                writeLock.unlock();
            }
        }

        return factory;
    }
View Full Code Here

  }

  @Override
  public List<String> getOutboundClients()
  {
    Lock readLock = acquireReadLock();
    try
    {
      ArrayList<String> result = new ArrayList<String>(_outboundTrafficPerClientStats.keySet());
      return result;
    }
View Full Code Here

  }

  @Override
  public ContainerTrafficTotalStats getOutboundClientStats(String client)
  {
    Lock readLock = acquireReadLock();
    try
    {
      ContainerTrafficTotalStats result = _outboundTrafficPerClientStats.get(client);
      return result;
    }
View Full Code Here

  {
    if (!_enabled.get()) return;

    _outboundTrafficTotalStatsMBean.registerConnectionOpen(_curClient);

    Lock writeLock = acquireWriteLock();
    try
    {
      if (NO_PEER != _curClient)
      {
        ContainerTrafficTotalStats clientStats = getOrAddPerClientOutboundCollector(_curClient, writeLock);
View Full Code Here

  {
    if (!_enabled.get()) return;

    _inboundTrafficTotalStatsMBean.registerConnectionOpen(_curClient);

    Lock writeLock = acquireWriteLock();
    try
    {
      /* FIXME add per-client handling
      if (NO_PEER != _curClient)
      {
View Full Code Here

  {
    _outboundTrafficTotalStatsMBean.mergeStats(other._outboundTrafficTotalStatsMBean);
    _inboundTrafficTotalStatsMBean.mergeStats(other._inboundTrafficTotalStatsMBean);
    _containerStats.mergeStats(other._containerStats);

    Lock otherReadLock = other.acquireReadLock();
    Lock writeLock = acquireWriteLock(otherReadLock);
    try
    {

      for (String clientName: other._outboundTrafficPerClientStats.keySet())
      {
View Full Code Here

  {
    _outboundTrafficTotalStatsMBean.reset();
    _inboundTrafficTotalStatsMBean.reset();
    _containerStats.reset();

    Lock readLock = acquireReadLock();
    try
    {

      for (String client: _outboundTrafficPerClientStats.keySet())
      {
View Full Code Here

  }

  private ContainerTrafficTotalStats getOrAddPerClientOutboundCollector(
      String client, Lock writeLock)
  {
    Lock myWriteLock = null;
    if (null == writeLock) myWriteLock = acquireWriteLock();
    try
    {
      ContainerTrafficTotalStats clientStats = _outboundTrafficPerClientStats.get(client);
      if (null == clientStats)
View Full Code Here

  }

  @Override
  public long getNumClosedDbConns()
  {
    Lock readLock = acquireReadLock();
    try
    {
      return _event.numClosedDbConns;
    }
    finally
View Full Code Here

TOP

Related Classes of java.util.concurrent.locks.Lock

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.