/** * Logs a message indicating initialization of this component */ @VisibleForTesting protected void logInitialize(){ final StringBuilder sysInfoLog = new StringBuilder(); sysInfoLog.append( "\n-------------------------------------------------\n\n" ); sysInfoLog.append( "Initializing " ).append(getNexusNameForLogs()); sysInfoLog.append( "\n\n-------------------------------------------------" ); getLogger().info( sysInfoLog.toString() ); }
public void initialize() throws InitializationException { logInitialize(); artifactPackagingMapper.setPropertiesFile( new File( nexusConfiguration.getConfigurationDirectory(), MAPPING_PROPERTIES_FILE ) ); // load locally present plugins getLogger().info( "Activating locally installed plugins..." ); Collection<PluginManagerResponse> activationResponse = nexusPluginManager.activateInstalledPlugins(); for ( PluginManagerResponse response : activationResponse ) { if ( response.isSuccessful() ) { getLogger().info( response.formatAsString( getLogger().isDebugEnabled() ) ); } else { getLogger().warn( response.formatAsString( getLogger().isDebugEnabled() ) ); } } applicationStatusSource.setState( SystemState.STOPPED ); applicationStatusSource.getSystemStatus().setOperationMode( OperationMode.STANDALONE ); applicationStatusSource.getSystemStatus().setInitializedAt( new Date() ); eventBus.post( new NexusInitializedEvent( this ) ); }
getLogger().info( "This is 1st start of new Nexus instance." ); getLogger().info( "This is an upgraded instance of Nexus." ); if(getLogger().isInfoEnabled()) getLogger().info( "Nexus Work Directory : {}", workDirPath ); getLogger().info( "Started {}", getNexusNameForLogs() ); getLogger().error( "Could not start Nexus, bad IO exception!", e ); getLogger().error( "Could not start Nexus, user configuration exception!", e );
protected void stopService() throws Exception { applicationStatusSource.getSystemStatus().setState( SystemState.STOPPING ); // Due to no dependency mechanism in NX for components, we need to fire off a hint about shutdown first eventBus.post( new NexusStoppingEvent( this ) ); nexusScheduler.shutdown(); eventBus.post( new NexusStoppedEvent( this ) ); nexusConfiguration.dropInternals(); securitySystem.stop(); applicationStatusSource.getSystemStatus().setState( SystemState.STOPPED ); // Now a cleanup, to kill dangling thread of HttpClients CustomMultiThreadedHttpConnectionManager.shutdownAll(); getLogger().info( "Stopped {}", getNexusNameForLogs()); }