[jboss-cvs] JBossAS SVN: r87550 - in branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered: sync and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 20 03:37:43 EDT 2009
Author: bstansberry at jboss.com
Date: 2009-04-20 03:37:43 -0400 (Mon, 20 Apr 2009)
New Revision: 87550
Modified:
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java
branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java
Log:
[JBAS-5552] Logging
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java 2009-04-20 07:29:19 UTC (rev 87549)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java 2009-04-20 07:37:43 UTC (rev 87550)
@@ -57,7 +57,11 @@
@Override
protected void doComplete() throws Exception
{
- // no-op
+ if (getLogger().isTraceEnabled())
+ {
+ ContentModification mod = getRepositoryContentModification();
+ getLogger().trace("doComplete(): " + mod.getType() + " for " + mod.getItem().getRelativePath());
+ }
}
@Override
@@ -84,7 +88,15 @@
}
}
- return modifyTarget();
+ boolean result = modifyTarget();
+ if (getLogger().isTraceEnabled())
+ {
+ ContentModification mod = getRepositoryContentModification();
+ getLogger().trace("doPrepare(): modifyTarget result for " +
+ mod.getType() + " for " + mod.getItem().getRelativePath() +
+ " is " + result);
+ }
+ return result;
}
catch (Exception e)
{
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java 2009-04-20 07:29:19 UTC (rev 87549)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java 2009-04-20 07:37:43 UTC (rev 87550)
@@ -107,6 +107,11 @@
protected void doComplete() throws Exception
{
safeCloseStream();
+ if (log.isTraceEnabled())
+ {
+ ContentModification mod = getRepositoryContentModification();
+ log.trace("doComplete(): " + mod.getType() + " for " + mod.getItem().getRelativePath());
+ }
}
@Override
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java 2009-04-20 07:29:19 UTC (rev 87549)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java 2009-04-20 07:37:43 UTC (rev 87550)
@@ -22,6 +22,7 @@
package org.jboss.system.server.profileservice.repository.clustered.sync;
+import org.jboss.logging.Logger;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
import org.jboss.system.server.profileservice.repository.clustered.sync.ContentModification.Type;
@@ -43,7 +44,8 @@
*/
public class LocalContentModificationGenerator extends AbstractContentModificationGenerator
{
-
+ private static final Logger log = Logger.getLogger(LocalContentModificationGenerator.class);
+
@Override
protected void handleAddition(String rootName,
RepositoryItemMetadata item, GeneratedModifications mods)
@@ -53,6 +55,11 @@
drainPreapprovedRemovals(mods);
Type type = item.isDirectory() ? Type.MKDIR_TO_CLUSTER : Type.PUSH_TO_CLUSTER;
mods.addModification(new ContentModification(type, rootName, item));
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + type + " modification for " + item.getRelativePath());
+ }
}
// @Override
@@ -95,7 +102,12 @@
// So, drain any remaining preapproved removals
drainPreapprovedRemovals(mods);
- mods.addModification(new ContentModification(Type.MKDIR_TO_CLUSTER, rootName, modified));
+ mods.addModification(new ContentModification(Type.MKDIR_TO_CLUSTER, rootName, modified));
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.MKDIR_TO_CLUSTER + " modification for " + modified.getRelativePath());
+ }
}
@Override
@@ -119,8 +131,13 @@
// on the stack to be inserted once all the child removals
// are done.
ContentModification mod = new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified);
- mods.pushPreapprovedRemoveParent(mod);
+ mods.pushPreapprovedRemoveParent(mod);
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.PUSH_TO_CLUSTER + " modification for " + modified.getRelativePath());
+ }
+
}
@Override
@@ -131,7 +148,12 @@
// So, drain any remaining preapproved removals
drainPreapprovedRemovals(mods);
- mods.addModification(new ContentModification(Type.DIR_TIMESTAMP_MISMATCH, rootName, base));
+ mods.addModification(new ContentModification(Type.DIR_TIMESTAMP_MISMATCH, rootName, base));
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.DIR_TIMESTAMP_MISMATCH + " modification for " + base.getRelativePath());
+ }
}
@Override
@@ -142,7 +164,12 @@
// So, drain any remaining preapproved removals
drainPreapprovedRemovals(mods);
- mods.addModification(new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified));
+ mods.addModification(new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified));
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.PUSH_TO_CLUSTER + " modification for " + modified.getRelativePath());
+ }
}
@Override
@@ -161,12 +188,22 @@
mods.addModification(new ContentModification(Type.PREPARE_RMDIR_TO_CLUSTER, rootName, item));
// Push the actual removal on the stack to execute when
// children are done
- mods.pushPreapprovedRemoveParent(removal);
+ mods.pushPreapprovedRemoveParent(removal);
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.PREPARE_RMDIR_TO_CLUSTER + " modification for " + item.getRelativePath());
+ }
}
else
{
mods.addModification(removal);
- }
+ }
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("created " + Type.REMOVE_TO_CLUSTER + " modification for " + item.getRelativePath());
+ }
}
}
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java 2009-04-20 07:29:19 UTC (rev 87549)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java 2009-04-20 07:37:43 UTC (rev 87550)
@@ -22,6 +22,7 @@
package org.jboss.system.server.profileservice.repository.clustered.sync;
+import org.jboss.logging.Logger;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
@@ -36,6 +37,7 @@
public class RemoteRemovalAction<T extends SynchronizationActionContext>
extends SimpleSynchronizationRemoteAction<T>
{
+ private static final Logger log = Logger.getLogger(RemoteRemovalAction.class);
public RemoteRemovalAction(T context, ContentModification modification)
{
@@ -49,6 +51,12 @@
RepositoryContentMetadata contentMetadata = getContext().getInProgressMetadata();
RepositoryRootMetadata rmd = contentMetadata.getRepositoryRootMetadata(mod.getRootName());
rmd.addItemMetadata(getMarkedRemovedItem(mod));
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("doCommit(): added removal metadata for " + mod.getType() +
+ " for " + mod.getItem().getRelativePath());
+ }
}
}
Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java 2009-04-20 07:29:19 UTC (rev 87549)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java 2009-04-20 07:37:43 UTC (rev 87550)
@@ -22,6 +22,7 @@
package org.jboss.system.server.profileservice.repository.clustered.sync;
+import org.jboss.logging.Logger;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
@@ -38,6 +39,8 @@
public class RemovalMetadataInsertionAction<T extends SynchronizationActionContext>
extends NoOpSynchronizationAction<T>
{
+ private static final Logger log = Logger.getLogger(RemovalMetadataInsertionAction.class);
+
private RepositoryItemMetadata replaced;
/**
@@ -68,11 +71,17 @@
if (rmd != null)
{
replaced = rmd.getItemMetadata(mod.getItem().getRelativePathElements());
- if (replaced == null)
- {
+ // BES 2009/04/20 I see no reason not to do this if replaced != null
+// if (replaced == null)
+// {
rmd.addItemMetadata(mod.getItem());
ok = true;
- }
+// }
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("added removal metadata for " + mod.getItem().getRelativePath());
+ }
}
return ok;
}
More information about the jboss-cvs-commits
mailing list