public void setName(String name)
    {
        synchronized(Pool.class)
        {
            if(isStarted())
            {
                if((name==null&&_pool.getPoolName()!=null)||(name!=null&&!name.equals(_pool.getPoolName())))
                    throw new IllegalStateException("started");
                return;
            }
            
            if(name==null)
            {
                if(_pool.getPoolName()!=null)
                {               
                    _pool=new Pool();
                    _pool.setPoolName(getName());
                }
            }
            else if (!name.equals(getName()))
            {
                Pool pool=Pool.getPool(name);
                if(pool==null)
                    _pool.setPoolName(name);
                else
                    _pool=pool;       
            }
        }
    }
public void setName ( String name ) { synchronized ( Pool . class ) { if ( isStarted ( ) ) { if ( ( name == null && _pool . getPoolName ( ) != null ) || ( name != null && ! name . equals ( _pool . getPoolName ( ) ) ) ) throw new IllegalStateException ( "started" ) ; return ; } if ( name == null ) { if ( _pool . getPoolName ( ) != null ) { _pool = new Pool ( ) ; _pool . setPoolName ( getName ( ) ) ; } } else if ( ! name . equals ( getName ( ) ) ) { Pool pool = Pool . getPool ( name ) ; if ( pool == null ) _pool . setPoolName ( name ) ; else _pool = pool ; } } }
Set the Pool name. All ThreadPool instances with the same Pool name will share the same Pool
instance. Thus they will share the same max, min and available Threads. The field values of
the first ThreadPool to call setPoolName with a specific name are used for the named Pool.
Subsequent ThreadPools that join the name pool will loose their private values.

@param name Name of the Pool instance this ThreadPool uses or null for an anonymous private
pool.