Added: lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/cms/repository/metadata/MetaDataRegistry.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/cms/repository/metadata/MetaDataRegistry.java?rev=742811&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/cms/repository/metadata/MetaDataRegistry.java (added)
+++ lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/cms/repository/metadata/MetaDataRegistry.java Tue Feb 10 01:34:58 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.repository.metadata;
+
+/**
+ * Meta data registry.
+ */
+public interface MetaDataRegistry {
+
+ /**
+ * The service role.
+ */
+ String ROLE = MetaDataRegistry.class.getName();
+
+ /**
+ * @param namespaceUri The namespace URI of the element set.
+ * @return the element set.
+ * @throws MetaDataException if an error occurs.
+ */
+ ElementSet getElementSet(String namespaceUri) throws MetaDataException;
+
+ /**
+ * Checks if an element set is registered.
+ * @param namespaceUri The namespace URI.
+ * @return A boolean value.
+ * @throws MetaDataException if an error occurs.
+ */
+ boolean isRegistered(String namespaceUri) throws MetaDataException;
+
+ /**
+ * Register an element set.
+ * @param namespaceUri The namespace URI.
+ * @param elementSet The element set.
+ * @throws MetaDataException if a set is already registered for this name.
+ */
+ void register(String namespaceUri, ElementSet elementSet) throws MetaDataException;
+
+ /**
+ * @return The registered namespace URIs.
+ * @throws MetaDataException if an error occurs.
+ */
+ String[] getNamespaceUris() throws MetaDataException;
+
+}
Added: lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/Identity.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/Identity.java?rev=742811&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/Identity.java (added)
+++ lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/Identity.java Tue Feb 10 01:34:58 2009
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.lenya.transaction;
+
+public interface Identity {
+
+ String getUserId();
+
+}
Modified: lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/IdentityMapImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/IdentityMapImpl.java?rev=742811&r1=742810&r2=742811&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/IdentityMapImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/IdentityMapImpl.java Tue Feb 10 01:34:58 2009
@@ -24,25 +24,20 @@
import java.util.Map;
import java.util.Set;
-import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Identity map implementation.
*
* @version $Id$
*/
-public final class IdentityMapImpl extends AbstractLogEnabled implements IdentityMap {
+public final class IdentityMapImpl implements IdentityMap {
+
+ private static final Log logger = LogFactory.getLog(IdentityMapImpl.class);
private Map maps = Collections.synchronizedMap(new HashMap());
- /**
- * Ctor.
- * @param logger The logger.
- */
- public IdentityMapImpl(Log logger) {
- }
-
public Object get(IdentifiableFactory factory, String key) {
String type = factory.getType();
Map map = (Map) this.maps.get(type);
@@ -52,8 +47,8 @@
}
Object object = map.get(key);
- if (getLogger().isDebugEnabled())
- getLogger().debug("IdentityMapImpl::get() looked up type [" + type + "], key [" + key
+ if (logger.isDebugEnabled())
+ logger.debug("IdentityMapImpl::get() looked up type [" + type + "], key [" + key
+ "] in map, is it there ? " + (object != null));
if (object == null) {
Modified: lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/UnitOfWorkImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/UnitOfWorkImpl.java?rev=742811&r1=742810&r2=742811&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/UnitOfWorkImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository/src/main/java/org/apache/lenya/transaction/UnitOfWorkImpl.java Tue Feb 10 01:34:58 2009
@@ -23,26 +23,25 @@
import java.util.Map;
import java.util.Set;
-import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.commons.lang.Validate;
import org.apache.commons.logging.Log;
-import org.apache.lenya.ac.Identity;
+import org.apache.commons.logging.LogFactory;
/**
* Default implementation of a unit of work.
*
* @version $Id$
*/
-public class UnitOfWorkImpl extends AbstractLogEnabled implements UnitOfWork {
+public class UnitOfWorkImpl implements UnitOfWork {
+
+ private static final Log logger = LogFactory.getLog(UnitOfWorkImpl.class);
/**
* Ctor.
* @param map The identity map to use.
* @param identity The identity.
- * @param logger The logger.
*/
- public UnitOfWorkImpl(IdentityMap map, Identity identity, Log logger)
+ public UnitOfWorkImpl(IdentityMap map, Identity identity)
{
Validate.notNull(map);
this.identityMap = map;
@@ -93,8 +92,8 @@
* @see org.apache.lenya.transaction.UnitOfWork#commit()
*/
public void commit() throws TransactionException {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("UnitOfWorkImpl::commit() called");
+ if (logger.isDebugEnabled()) {
+ logger.debug("UnitOfWorkImpl::commit() called");
}
Set lockedObjects = this.locks.keySet();
@@ -124,8 +123,8 @@
}
for (Iterator i = this.modifiedObjects.iterator(); i.hasNext();) {
Transactionable t = (Transactionable) i.next();
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("UnitOfWorkImpl::commit() calling save on [" + t + "]");
+ if (logger.isDebugEnabled()) {
+ logger.debug("UnitOfWorkImpl::commit() calling save on [" + t + "]");
}
t.saveTransactionable();
}
@@ -182,8 +181,8 @@
* @see org.apache.lenya.transaction.UnitOfWork#rollback()
*/
public synchronized void rollback() throws TransactionException {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("UnitOfWorkImpl::rollback() called");
+ if (logger.isDebugEnabled()) {
+ logger.debug("UnitOfWorkImpl::rollback() called");
}
if (getIdentityMap() != null) {
Object[] objects = getIdentityMap().getObjects();
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.