|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.storage.BrokerPool
This class controls all available instances of the database. Use it to configure, start and stop database instances. You may have multiple instances defined, each using its own configuration, database directory etc.. To define multiple instances, pass an identification string to the static method configure() and use getInstance(id) to retrieve an instance.
Nested Class Summary | |
protected class |
BrokerPool.ShutdownThread
|
Field Summary | |
protected Configuration |
conf
|
static java.lang.String |
DEFAULT_INSTANCE
|
Constructor Summary | |
BrokerPool(java.lang.String id,
int minBrokers,
int maxBrokers,
Configuration config)
Constructor for the BrokerPool object |
Method Summary | |
int |
active()
Number of active Brokers in this pool. |
int |
available()
Number of available Brokers in this pool. |
static void |
configure(int minBrokers,
int maxBrokers,
Configuration config)
|
static void |
configure(java.lang.String id,
int minBrokers,
int maxBrokers,
Configuration config)
Configure a new BrokerPool instance. |
protected DBBroker |
createBroker()
Description of the Method |
DBBroker |
get()
Get a DBBroker instance from the pool. |
Configuration |
getConfiguration()
|
java.lang.String |
getId()
|
static BrokerPool |
getInstance()
|
static BrokerPool |
getInstance(java.lang.String id)
Singleton method. |
static java.util.Iterator |
getInstances()
|
int |
getMax()
Returns maximum of concurrent Brokers. |
SecurityManager |
getSecurityManager()
Returns the security manager responsible for this pool |
protected void |
initialize()
Initialize the current instance. |
static boolean |
isConfigured()
|
static boolean |
isConfigured(java.lang.String id)
|
boolean |
isInstanceConfigured()
Has this BrokerPool been configured? |
void |
registerShutdownListener(ShutdownListener listener)
|
void |
release(DBBroker broker)
Release a DBBroker instance into the pool. |
void |
reloadSecurityManager(DBBroker broker)
Reload the security manager. |
void |
shutdown()
Shutdown all brokers. |
static void |
stop()
|
static void |
stop(java.lang.String id)
Shutdown running brokers. |
static void |
stopAll()
|
void |
sync(DBBroker broker)
Write buffers to disk. |
void |
triggerSync()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_INSTANCE
protected Configuration conf
Constructor Detail |
public BrokerPool(java.lang.String id, int minBrokers, int maxBrokers, Configuration config) throws EXistException
EXistException
- Description of the ExceptionMethod Detail |
public static final void configure(int minBrokers, int maxBrokers, Configuration config) throws EXistException
EXistException
public static final void configure(java.lang.String id, int minBrokers, int maxBrokers, Configuration config) throws EXistException
id
- The name to identify this database instance. You may have more
than one instance with different configurations.minBrokers
- Minimum number of database brokers to start during initialization.maxBrokers
- Maximum number of database brokers available to handle requests.config
- The configuration object used by this instance.
EXistException
- thrown if initialization fails.public static final boolean isConfigured(java.lang.String id)
public static final boolean isConfigured()
public static final BrokerPool getInstance(java.lang.String id) throws EXistException
EXistException
- thrown if the instance has not been configured.public static final BrokerPool getInstance() throws EXistException
EXistException
public static final java.util.Iterator getInstances()
public static final void stop(java.lang.String id) throws EXistException
EXistException
public static final void stop() throws EXistException
EXistException
public static final void stopAll()
public int active()
public int available()
public Configuration getConfiguration()
protected DBBroker createBroker() throws EXistException
EXistException
- Description of the Exceptionpublic DBBroker get() throws EXistException
EXistException
- Description of the Exceptionpublic SecurityManager getSecurityManager()
public void reloadSecurityManager(DBBroker broker)
broker
- protected void initialize() throws EXistException
EXistException
- Description of the Exceptionpublic void release(DBBroker broker)
broker
- Description of the Parameterpublic void sync(DBBroker broker)
broker
- public void shutdown()
public int getMax()
public java.lang.String getId()
public final boolean isInstanceConfigured()
public void triggerSync()
public void registerShutdownListener(ShutdownListener listener)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |