public interface Db4oService
Db4oService db4oService = (Db4oService)bundleContext.getService(serviceRef);
Configuration config = db4oService.newConfiguration();
// ...
ObjectContainer database = db4oService.openFile(config,fileName);
Configuration config = Db4o.newConfiguration();
config.reflectWith(new JdkReflector(SomeData.class.getClassLoader()));
// ...
ObjectContainer database = Db4o.openFile(config,fileName);
| Modifier and Type | Method and Description |
|---|---|
Configuration |
newConfiguration()
Creates a fresh
Configuration instance. |
ObjectContainer |
openClient(Configuration config,
java.lang.String hostName,
int port,
java.lang.String user,
java.lang.String password)
opens an
ObjectContainer
client and connects it to the specified named server and port. |
ObjectContainer |
openClient(java.lang.String hostName,
int port,
java.lang.String user,
java.lang.String password)
Operates just like
Db4o.openClient(Configuration, String, int, String, String), but uses
a newly created, vanilla Configuration context. |
ObjectContainer |
openFile(Configuration config,
java.lang.String databaseFileName)
opens an
ObjectContainer
on the specified database file for local use. |
ObjectContainer |
openFile(java.lang.String databaseFileName)
Operates just like
Db4o.openFile(Configuration, String), but uses
a newly created, vanilla Configuration context. |
ObjectServer |
openServer(Configuration config,
java.lang.String databaseFileName,
int port)
opens an
ObjectServer
on the specified database file and port. |
ObjectServer |
openServer(java.lang.String databaseFileName,
int port)
Operates just like
Db4o.openServer(Configuration, String, int), but uses
a newly created, vanilla Configuration context. |
Configuration newConfiguration()
Configuration instance.ObjectContainer openClient(java.lang.String hostName, int port, java.lang.String user, java.lang.String password) throws Db4oException
Db4o.openClient(Configuration, String, int, String, String), but uses
a newly created, vanilla Configuration context.
opens an ObjectContainer
client and connects it to the specified named server and port.
allow access for the specified user and password.
ObjectContainer can be cast to
ExtClient to use extended
ExtObjectContainer
and ExtClient methods.
hostName - the host nameport - the port the server is usinguser - the user namepassword - the user passwordObjectContainerDb4oExceptionObjectServer.grantAccess(java.lang.String, java.lang.String)ObjectContainer openClient(Configuration config, java.lang.String hostName, int port, java.lang.String user, java.lang.String password) throws Db4oException
ObjectContainer
client and connects it to the specified named server and port.
allow access for the specified user and password.
ObjectContainer can be cast to
ExtClient to use extended
ExtObjectContainer
and ExtClient methods.
config - a custom Configuration instance to be obtained via Db4o.newConfiguration()hostName - the host nameport - the port the server is usinguser - the user namepassword - the user passwordObjectContainerDb4oExceptionObjectServer.grantAccess(java.lang.String, java.lang.String)ObjectContainer openFile(java.lang.String databaseFileName) throws Db4oException
Db4o.openFile(Configuration, String), but uses
a newly created, vanilla Configuration context.
opens an ObjectContainer
on the specified database file for local use.
ObjectContainer against the same file will result in
a DatabaseFileLockedException.databaseFileName - an absolute or relative path to the database fileObjectContainerDb4oExceptionConfiguration.readOnly(boolean),
Configuration.encrypt(boolean),
Configuration.password(java.lang.String)ObjectContainer openFile(Configuration config, java.lang.String databaseFileName) throws Db4oException
ObjectContainer
on the specified database file for local use.
ObjectContainer against the same file will result in
a DatabaseFileLockedException.config - a custom Configuration instance to be obtained via Db4o.newConfiguration()databaseFileName - an absolute or relative path to the database fileObjectContainerDb4oExceptionConfiguration.readOnly(boolean),
Configuration.encrypt(boolean),
Configuration.password(java.lang.String)ObjectServer openServer(java.lang.String databaseFileName, int port) throws Db4oException
Db4o.openServer(Configuration, String, int), but uses
a newly created, vanilla Configuration context.
opens an ObjectServer
on the specified database file and port.
ObjectServer.openClient(), specify '0' as the
port number.databaseFileName - an absolute or relative path to the database fileport - the port to be used, or 0, if the server should not open a port,
because it will only be used with ObjectServer.openClient()ObjectServer listening
on the specified port.Db4oExceptionConfiguration.readOnly(boolean),
Configuration.encrypt(boolean),
Configuration.password(java.lang.String)ObjectServer openServer(Configuration config, java.lang.String databaseFileName, int port) throws Db4oException
ObjectServer
on the specified database file and port.
ObjectServer.openClient(), specify '0' as the
port number.config - a custom Configuration instance to be obtained via Db4o.newConfiguration()databaseFileName - an absolute or relative path to the database fileport - the port to be used, or 0, if the server should not open a port,
because it will only be used with ObjectServer.openClient()ObjectServer listening
on the specified port.Db4oExceptionConfiguration.readOnly(boolean),
Configuration.encrypt(boolean),
Configuration.password(java.lang.String)