|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Context
public final class Context
This class serves as a central database context. It references the currently opened database, properties, client sessions, users and other meta data. Next, the instance of this class will be passed on to all operations, as it organizes concurrent data access, ensuring that no process will concurrently write to the same data instances.
Field Summary | |
---|---|
ClientBlocker |
blocker
Blocked clients. |
Nodes |
copied
Copied nodes. |
Databases |
databases
Databases list. |
Datas |
dbs
Opened databases. |
Events |
events
Event pool. |
int |
focused
Focused node. |
ClientListener |
listener
Client listener. |
Log |
log
Log. |
Nodes |
marked
Marked nodes. |
MainProp |
mprop
Main properties. |
Prop |
prop
Client-related properties. |
Repo |
repo
Package repository. |
Sessions |
sessions
Client connections. |
User |
user
User reference. |
Users |
users
Users. |
Constructor Summary | |
---|---|
Context()
Default constructor, which is usually called once in the lifetime of a project. |
|
Context(boolean file)
Default constructor, which is usually called once in the lifetime of a project. |
|
Context(Context ctx,
ClientListener cl)
Constructor, called by clients, and adopting the variables of the main process. |
Method Summary | |
---|---|
void |
close()
Closes the database context. |
void |
closeDB()
Closes the current database context. |
Nodes |
current()
Returns the current node context. |
void |
current(Nodes curr)
Sets the current node context. |
Data |
data()
Returns the current data reference. |
void |
downgrade(Proc pr,
StringList write)
Downgrades locks. |
void |
openDB(Data d)
Sets the specified data instance as current database. |
boolean |
perm(Perm p,
MetaData md)
Checks if the current user has the specified permission. |
boolean |
pinned(java.lang.String db)
Checks if the specified database is pinned. |
void |
register(Proc pr)
Locks the specified process and starts a timeout thread. |
boolean |
root()
Returns true if a data reference exists and if the current node set contains
all documents. |
void |
set(Nodes curr,
Nodes mark)
Sets the current context and marked node set and resets the focus. |
void |
unregister(Proc pr)
Unlocks the process and stops the timeout. |
void |
update()
Invalidates the current node set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final ClientListener listener
null
in standalone/server mode.
public final ClientBlocker blocker
public final Prop prop
public final MainProp mprop
public final Sessions sessions
public final Events events
public final Datas dbs
public final Users users
public final Repo repo
public final Databases databases
public User user
public final Log log
public Nodes marked
public Nodes copied
public int focused
Constructor Detail |
---|
public Context()
public Context(boolean file)
file
- retrieve properties from diskpublic Context(Context ctx, ClientListener cl)
user
reference must be set after calling this method.
ctx
- context of the main processcl
- client listenerMethod Detail |
---|
public void close()
public boolean root()
true
if a data reference exists and if the current node set contains
all documents.
public Data data()
public Nodes current()
public void current(Nodes curr)
curr
- node setpublic void openDB(Data d)
d
- data referencepublic void closeDB()
public void set(Nodes curr, Nodes mark)
curr
- context setmark
- marked nodespublic void update()
public boolean pinned(java.lang.String db)
db
- name of database
public boolean perm(Perm p, MetaData md)
p
- requested permissionmd
- optional meta data reference
public void register(Proc pr)
pr
- processpublic void downgrade(Proc pr, StringList write)
pr
- processwrite
- write locks to keeppublic void unregister(Proc pr)
pr
- process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |