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;       
            }
        }
    }