diff options
author | Olivier Lamy <olamy@apache.org> | 2012-12-19 15:18:31 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-12-19 15:18:31 +0000 |
commit | 0c55117416a2fd829e840015ce3c1cbed4232a5a (patch) | |
tree | f47b890a855a2952b2d44040f0dd65767d2d24ba /archiva-modules/plugins/metadata-store-jcr | |
parent | a538626d57b6174eb7b401eff7e683198ee48c71 (diff) | |
download | archiva-0c55117416a2fd829e840015ce3c1cbed4232a5a.tar.gz archiva-0c55117416a2fd829e840015ce3c1cbed4232a5a.zip |
add some StopWatch to get time on what happened here
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1423874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/metadata-store-jcr')
2 files changed, 15 insertions, 1 deletions
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java index 46655b901..a53a176f2 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java @@ -75,6 +75,7 @@ import java.util.Set; public class JcrMetadataRepository implements MetadataRepository { + private static final String JCR_LAST_MODIFIED = "jcr:lastModified"; static final String NAMESPACE_NODE_TYPE = "archiva:namespace"; @@ -108,6 +109,7 @@ public class JcrMetadataRepository static void initialize( Session session ) throws RepositoryException { + // TODO: consider using namespaces for facets instead of the current approach: // (if used, check if actually called by normal injection) // for ( String facetId : metadataFacetFactories.keySet() ) @@ -130,6 +132,7 @@ public class JcrMetadataRepository registerMixinNodeType( nodeTypeManager, JcrMetadataRepository.ARTIFACT_NODE_TYPE ); registerMixinNodeType( nodeTypeManager, JcrMetadataRepository.FACET_NODE_TYPE ); registerMixinNodeType( nodeTypeManager, JcrMetadataRepository.DEPENDENCY_NODE_TYPE ); + } private static void registerMixinNodeType( NodeTypeManager nodeTypeManager, String name ) diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java index 5f9fde8e5..2f41d4d6f 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java @@ -25,6 +25,9 @@ import org.apache.archiva.metadata.repository.MetadataResolver; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.StopWatch; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; @@ -38,11 +41,13 @@ import java.util.Map; /** * */ -@Service( "repositorySessionFactory#jcr" ) +@Service("repositorySessionFactory#jcr") public class JcrRepositorySessionFactory implements RepositorySessionFactory { + private Logger logger = LoggerFactory.getLogger( getClass() ); + @Inject private ApplicationContext applicationContext; @@ -87,6 +92,9 @@ public class JcrRepositorySessionFactory public void initialize() throws Exception { + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); + metadataFacetFactories = applicationContext.getBeansOfType( MetadataFacetFactory.class ); // olamy with spring the "id" is now "metadataFacetFactory#hint" // whereas was only hint with plexus so let remove metadataFacetFactory# @@ -118,5 +126,8 @@ public class JcrRepositorySessionFactory metadataRepository.close(); } } + + stopWatch.stop(); + logger.info( "time to initialize JcrRepositorySessionFactory: {}", stopWatch.getTime() ); } } |