コード例 #1
0
  public void apply(InternalObjectContainer container) {
    final Queries queries = Db4oMBeans.newQueriesMBean(container);
    final CommonConfiguration config =
        Db4oLegacyConfigurationBridge.asCommonConfiguration(container.configure());
    config
        .diagnostic()
        .addListener(
            new DiagnosticListener() {
              public void onDiagnostic(Diagnostic d) {
                if (d instanceof LoadedFromClassIndex) {
                  queries.notifyClassIndexScan((LoadedFromClassIndex) d);
                }
              }
            });

    final EventRegistry events = EventRegistryFactory.forObjectContainer(container);
    events
        .queryStarted()
        .addListener(
            new EventListener4<QueryEventArgs>() {
              public void onEvent(Event4<QueryEventArgs> e, QueryEventArgs args) {
                queries.notifyQueryStarted();
              }
            });

    events
        .queryFinished()
        .addListener(
            new EventListener4<QueryEventArgs>() {
              public void onEvent(Event4<QueryEventArgs> e, QueryEventArgs args) {
                queries.notifyQueryFinished();
              }
            });
  }
コード例 #2
0
 public CommonConfiguration common() {
   return Db4oLegacyConfigurationBridge.asCommonConfiguration(legacy());
 }
コード例 #3
0
 public FileConfiguration file() {
   return Db4oLegacyConfigurationBridge.asFileConfiguration(legacy());
 }