/** * Builds the directory server instance. * * @param name the instance name */ private void build( String name ) throws Exception { directoryService.setInstanceId( name ); buildInstanceDirectory( name ); CacheService cacheService = new CacheService(); cacheService.initialize( directoryService.getInstanceLayout() ); directoryService.setCacheService( cacheService ); // Init the service now initSchema(); initSystemPartition(); directoryService.startup(); }
@Deactivate public void deactivate(BundleContext context) { try { service.stop(); try { service.stop(); } catch(Exception e) { log.error("ApacheDsService shutdown" ,e); } if (cacheService != null) { try { cacheService.destroy(); } catch(Exception e) { log.error("Cache Service shutdown" ,e); } } if (serviceReg != null) { try { context.ungetService(serviceReg.getReference()); } catch (Throwable th) { log.error("Error on unget service", serviceReg); } } } catch (Exception e) { log.error("Error deactivating Apache Directory Service", e); } }
CacheService cacheService = new CacheService(); cacheService.initialize( instanceLayout ); DnFactory dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) ); initSchemaLdifPartition( instanceLayout, dnFactory ); initConfigPartition( instanceLayout, dnFactory, cacheService );
/** * Creates a new instance of ApacheDsService. It initializes the directory * service. * * @throws Exception * If something went wrong */ @Activate public void activate(BundleContext context) { File workDir; try { workDir = new File(getDsHome(context)); log.info("ApacheDsService startup: schema.resource.location ="+context.getBundle().getSymbolicName()+"("+context.getBundle().getBundleId()+") - working directory: "+workDir.getAbsolutePath()); cacheService = new CacheService(); service = new ApacheDsService(); service.start(new InstanceLayout(workDir), cacheService); serviceReg = context.registerService(ApacheDsService.class.getName(), service, null); } catch (IOException e) { log.error("Error activating Apache Directory Service", e); } catch (Exception e) { log.error("Error activating Apache Directory Service", e); } }
ehCacheConfig.addDefaultCache(defaultCache); cacheManager = new CacheManager(ehCacheConfig); CacheService cacheService = new CacheService(cacheManager); DnFactory dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
/** * Initialize the CacheService * * @param layout The place on disk where the cache configuration will be stored */ public void initialize( InstanceLayout layout ) { initialize( layout, null ); }
cacheService = new CacheService(); cacheService.initialize( instanceLayout ); dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
Configuration config = ConfigurationFactory.parseConfiguration(configURL); config.setName(config.getName() + '_' + System.identityHashCode(this)); directoryService.setCacheService(new CacheService(new CacheManager(config)));
entryCache = cacheService.getCache( getId() );
directoryService.setInstanceLayout(new InstanceLayout(cwd)); cacheService = new CacheService(); cacheService.initialize(directoryService.getInstanceLayout()); directoryService.setDnFactory(new DefaultDnFactory(directoryService.getSchemaManager(), cacheService.getCache("dnCache")));
/** * Builds the directory server instance. * * @param name the instance name */ private void build( String name ) throws Exception { directoryService.setInstanceId( name ); buildInstanceDirectory( name ); CacheService cacheService = new CacheService(); cacheService.initialize( directoryService.getInstanceLayout(), name ); directoryService.setCacheService( cacheService ); // Init the service now initSchema(); initSystemPartition(); directoryService.startup(); }
ds.setInstanceLayout(new InstanceLayout(workDir)); CacheService cacheService = new CacheService(); ds.setCacheService(cacheService);
cacheService.destroy();
CacheService cacheService = new CacheService(); cacheService.initialize(layout); DnFactory dnFactory = new DefaultDnFactory(schemaManager, cacheService.getCache("dnCache")); service.setDnFactory(dnFactory);
this.service.setInstanceLayout(new InstanceLayout(this.dataDirectory.toFile())); final CacheService cacheService = new CacheService(); cacheService.initialize(this.service.getInstanceLayout());
ds.setInstanceLayout(new InstanceLayout(workDir)); CacheService cacheService = new CacheService(); ds.setCacheService(cacheService);
/** * Sets the system context root to null. */ protected void tearDown() throws Exception { if (ldapServer != null) { ldapServer.stop(); } try { directoryService.shutdown(); } catch (Exception e) { // ignore } if (cacheService != null) { cacheService.destroy(); } } }
ds.setInstanceLayout(new InstanceLayout(workDir)); CacheService cacheService = new CacheService(); ds.setCacheService(cacheService);
ds.setInstanceLayout(new InstanceLayout(workDir)); CacheService cacheService = new CacheService(); ds.setCacheService(cacheService);