From: Dmitriy S. <sha...@gm...> - 2011-02-17 03:59:24
|
settings files ... plugins one as example, but also it will be used for others eXist settings files, like backup, serialize ... On Wed, Feb 16, 2011 at 11:23 PM, Adam Retter <ad...@ex...> wrote: > Whats it for? > > On 16 February 2011 16:33, Dmitriy Shabanov <sha...@gm...> wrote: > > Wolfgang did ask to do not use '/db/system' because it have 'rwurwu---', > but > > 'etc' 'rwurwuR--'. > > > > On Wed, Feb 16, 2011 at 7:29 PM, Adam Retter <ad...@ex...> wrote: > >> > >> What is /db/etc? Should this not be /db/system/etc if anything? > >> > >> > >> On 16 February 2011 14:13, <sha...@us...> wrote: > >> > Revision: 13782 > >> > http://exist.svn.sourceforge.net/exist/?rev=13782&view=rev > >> > Author: shabanovd > >> > Date: 2011-02-16 13:13:58 +0000 (Wed, 16 Feb 2011) > >> > > >> > Log Message: > >> > ----------- > >> > [feature] create '/db/etc' collection. > >> > > >> > Owner: SYSTEM with permissions: rwu; > >> > Group: DBA with permissions: rwu; > >> > Other's permissions: r--; > >> > > >> > It will be monitored by configuration trigger and it must/should be > used > >> > for settings which must/should be readable by world. > >> > > >> > Modified Paths: > >> > -------------- > >> > trunk/eXist/src/org/exist/storage/BrokerPool.java > >> > > >> > Modified: trunk/eXist/src/org/exist/storage/BrokerPool.java > >> > =================================================================== > >> > --- trunk/eXist/src/org/exist/storage/BrokerPool.java 2011-02-16 > >> > 13:03:39 UTC (rev 13781) > >> > +++ trunk/eXist/src/org/exist/storage/BrokerPool.java 2011-02-16 > >> > 13:13:58 UTC (rev 13782) > >> > @@ -961,25 +961,23 @@ > >> > }*/ > >> > > >> > /** > >> > - * Initialise system collections, if it doesnt exist yet > >> > + * Initialise system collections, if it doesn't exist yet > >> > * > >> > * @param sysBroker The system broker from before the brokerpool > is > >> > populated > >> > * @param sysCollectionUri XmldbURI of the collection to create > >> > - * @param permissions The persmissions to set on the created > >> > collection > >> > + * @param permissions The permissions to set on the created > >> > collection > >> > */ > >> > - private void initialiseSystemCollection(DBBroker sysBroker, > >> > XmldbURI sysCollectionUri, int permissions) throws EXistException { > >> > - //create /db/system > >> > - Collection sysCollection = > >> > sysBroker.getCollection(sysCollectionUri); > >> > - if (sysCollection == null) > >> > - { > >> > + private Collection initialiseSystemCollection(DBBroker sysBroker, > >> > XmldbURI sysCollectionUri, int permissions) throws EXistException { > >> > + Collection collection = > >> > sysBroker.getCollection(sysCollectionUri); > >> > + if (collection == null) { > >> > TransactionManager transact = getTransactionManager(); > >> > Txn txn = transact.beginTransaction(); > >> > try { > >> > - sysCollection = sysBroker.getOrCreateCollection(txn, > >> > sysCollectionUri); > >> > - if (sysCollection == null) > >> > + collection = sysBroker.getOrCreateCollection(txn, > >> > sysCollectionUri); > >> > + if (collection == null) > >> > throw new IOException("Could not create system > >> > collection: " + sysCollectionUri); > >> > - sysCollection.setPermissions(permissions); > >> > - sysBroker.saveCollection(txn, sysCollection); > >> > + collection.setPermissions(permissions); > >> > + sysBroker.saveCollection(txn, collection); > >> > > >> > transact.commit(txn); > >> > } catch (Exception e) { > >> > @@ -990,19 +988,36 @@ > >> > throw new EXistException(msg, e); > >> > } > >> > } > >> > + > >> > + return collection; > >> > } > >> > > >> > /** > >> > - * Initialise required system collections, if they dont exist yet > >> > + * Initialize required system collections, if they don't exist > yet > >> > * > >> > * @param sysBroker - The system broker from before the brokerpool > >> > is populated > >> > * > >> > * @throws EXistException If a system collection cannot be created > >> > */ > >> > - private void initialiseSystemCollections(DBBroker sysBroker) > throws > >> > EXistException > >> > + private void initialiseSystemCollections(DBBroker broker) throws > >> > EXistException > >> > { > >> > //create /db/system > >> > - initialiseSystemCollection(sysBroker, > >> > XmldbURI.SYSTEM_COLLECTION_URI, 0770); > >> > + initialiseSystemCollection(broker, > >> > XmldbURI.SYSTEM_COLLECTION_URI, 0770); > >> > + //create /db/etc > >> > + Collection collection = initialiseSystemCollection(broker, > >> > XmldbURI.ETC_COLLECTION_URI, 0774); > >> > + > >> > + //initialize configurations watcher trigger > >> > + if (collection != null) { > >> > + CollectionConfigurationManager manager = > >> > broker.getBrokerPool().getConfigurationManager(); > >> > + CollectionConfiguration collConf = > >> > manager.getOrCreateCollectionConfiguration(broker, collection); > >> > + try { > >> > + collConf.registerTrigger(broker, > >> > + "store,update,remove", > >> > + > >> > "org.exist.config.ConfigurationDocumentTrigger", null); > >> > + } catch (CollectionConfigurationException e) { > >> > + //LOG.error("Configuration changers > >> > watcher could not the initialized.", e); > >> > + } > >> > + } > >> > } > >> > > >> > public long getReservedMem() { > >> > > >> > > >> > This was sent by the SourceForge.net collaborative development > platform, > >> > the world's largest Open Source development site. > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio > >> > XE: > >> > Pinpoint memory and threading errors before they happen. > >> > Find and fix more than 250 security defects in the development cycle. > >> > Locate bottlenecks in serial and parallel code that limit performance. > >> > http://p.sf.net/sfu/intel-dev2devfeb > >> > _______________________________________________ > >> > Exist-commits mailing list > >> > Exi...@li... > >> > https://lists.sourceforge.net/lists/listinfo/exist-commits > >> > > >> > >> > >> > >> -- > >> Adam Retter > >> > >> eXist Developer > >> { United Kingdom } > >> ad...@ex... > >> irc://irc.freenode.net/existdb > > > > > > > > -- > > Dmitriy Shabanov > > > > > > -- > Adam Retter > > eXist Developer > { United Kingdom } > ad...@ex... > irc://irc.freenode.net/existdb > -- Dmitriy Shabanov |