com.alibaba.druid.pool.ha
Class DataSourceHolder

java.lang.Object
  extended by com.alibaba.druid.pool.ha.DataSourceHolder
All Implemented Interfaces:
Closeable

public class DataSourceHolder
extends Object
implements Closeable


Constructor Summary
DataSourceHolder(MultiDataSource multiDataSource, DruidDataSource dataSource)
           
 
Method Summary
 void close()
           
 long getConnectCount()
           
 MultiConnectionHolder getConnection()
           
 DruidDataSource getDataSource()
           
 String getUrl()
           
 int getWeight()
           
 int getWeightRegionBegin()
           
 int getWeightRegionEnd()
           
 void incrementConnectCount()
           
 boolean isEnable()
           
 boolean isFail()
           
 boolean isWritable()
           
 void resetState()
           
 void restart()
           
 void setEnable(boolean enable)
           
 void setFail(boolean fail)
           
 void setWeight(int weight)
           
 void setWeightRegionBegin(int weightRegionBegin)
           
 void setWeightRegionEnd(int weightReginEnd)
           
 void setWritable(boolean writable)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceHolder

public DataSourceHolder(MultiDataSource multiDataSource,
                        DruidDataSource dataSource)
Method Detail

isWritable

public boolean isWritable()

setWritable

public void setWritable(boolean writable)

getWeightRegionBegin

public int getWeightRegionBegin()

setWeightRegionBegin

public void setWeightRegionBegin(int weightRegionBegin)

getWeightRegionEnd

public int getWeightRegionEnd()

setWeightRegionEnd

public void setWeightRegionEnd(int weightReginEnd)

resetState

public void resetState()

getWeight

public int getWeight()

setWeight

public void setWeight(int weight)

isEnable

public boolean isEnable()

setEnable

public void setEnable(boolean enable)

isFail

public boolean isFail()

setFail

public void setFail(boolean fail)

getDataSource

public DruidDataSource getDataSource()

getConnectCount

public long getConnectCount()

incrementConnectCount

public void incrementConnectCount()

getUrl

public String getUrl()

getConnection

public MultiConnectionHolder getConnection()
                                    throws SQLException
Throws:
SQLException

close

public void close()
Specified by:
close in interface Closeable

restart

public void restart()


Copyright © 2012 Alibaba Group. All Rights Reserved.