add time info

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1435207 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-01-18 15:56:07 +00:00
parent acb0e671d4
commit c0bfa19864
2 changed files with 16 additions and 6 deletions

View File

@ -34,6 +34,7 @@ import org.apache.archiva.redback.rbac.UserAssignment;
import org.apache.archiva.redback.role.RoleManager; import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.redback.users.UserManager; import org.apache.archiva.redback.users.UserManager;
import org.apache.archiva.redback.components.registry.RegistryListener; import org.apache.archiva.redback.components.registry.RegistryListener;
import org.apache.commons.lang.time.StopWatch;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
@ -50,8 +51,6 @@ import java.util.Map.Entry;
/** /**
* ConfigurationSynchronization * ConfigurationSynchronization
*
*
*/ */
@Service @Service
public class SecuritySynchronization public class SecuritySynchronization
@ -63,7 +62,7 @@ public class SecuritySynchronization
private RoleManager roleManager; private RoleManager roleManager;
@Inject @Inject
@Named( value = "rbacManager#cached" ) @Named(value = "rbacManager#cached")
private RBACManager rbacManager; private RBACManager rbacManager;
private Map<String, EnvironmentCheck> checkers; private Map<String, EnvironmentCheck> checkers;
@ -97,7 +96,8 @@ public class SecuritySynchronization
return beans; return beans;
} }
public void afterConfigurationChange( org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue ) public void afterConfigurationChange( org.apache.archiva.redback.components.registry.Registry registry,
String propertyName, Object propertyValue )
{ {
if ( ConfigurationNames.isManagedRepositories( propertyName ) && propertyName.endsWith( ".id" ) ) if ( ConfigurationNames.isManagedRepositories( propertyName ) && propertyName.endsWith( ".id" ) )
{ {
@ -108,7 +108,8 @@ public class SecuritySynchronization
} }
} }
public void beforeConfigurationChange( org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue ) public void beforeConfigurationChange( org.apache.archiva.redback.components.registry.Registry registry,
String propertyName, Object propertyValue )
{ {
/* do nothing */ /* do nothing */
} }
@ -176,6 +177,10 @@ public class SecuritySynchronization
"Unable to initialize the Redback Security Environment, " + "no Environment Check components found." ); "Unable to initialize the Redback Security Environment, " + "no Environment Check components found." );
} }
StopWatch stopWatch = new StopWatch();
stopWatch.reset();
stopWatch.start();
List<String> violations = new ArrayList<String>(); List<String> violations = new ArrayList<String>();
for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() ) for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
@ -210,8 +215,12 @@ public class SecuritySynchronization
throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size() throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size()
+ "] violation(s) encountered, See log for details." ); + "] violation(s) encountered, See log for details." );
} }
stopWatch.stop();
log.info( "time to execute all EnvironmentCheck: {} ms", stopWatch.getTime() );
} }
private void assignRepositoryObserverToGuestUser( List<ManagedRepositoryConfiguration> repos ) private void assignRepositoryObserverToGuestUser( List<ManagedRepositoryConfiguration> repos )
{ {
for ( ManagedRepositoryConfiguration repoConfig : repos ) for ( ManagedRepositoryConfiguration repoConfig : repos )

View File

@ -27,7 +27,8 @@
<appenders> <appenders>
<Console name="console" target="SYSTEM_OUT"> <Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> <!--PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/-->
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n}" />
</Console> </Console>
<!--RollingFile name="console" fileName="${logsDirectory}/archiva.log" <!--RollingFile name="console" fileName="${logsDirectory}/archiva.log"