Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed 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 com.helger.webbasics.mgr;
 
 
 
 
 public final class MetaSystemManager extends GlobalSingleton
 {
   public static final String DIRECTORY_AUDITS = "audits/";
   public static final String SMTP_SETTINGS_XML = "smtpsettings.xml";
   public static final String FAILED_MAILS_XML = "failedmails.xml";
   public static final String SYSTEM_MIGRATIONS_XML = "systemmigrations.xml";
   public static final String SYSTEM_MESSAGE_XML = "systemmessage.xml";
 
   private static final Logger s_aLogger = LoggerFactory.getLogger (MetaSystemManager.class);
 
   private AuditManager m_aAuditMgr;
 
   public MetaSystemManager ()
   {}
 
   @Override
   protected void onAfterInstantiation ()
   {
     try
     {
        = new AuditManager (, LoggedInUserManager.getInstance ());
       AuditUtils.setAuditor (.getAuditor ());
 
 
       ScopedMailAPI.getInstance ().setFailedMailQueue ();
 
 
 
       .info ("MetaSystemManager was initialized");
     }
     catch (final DAOException ex)
     {
       throw new InitializationException ("Failed to init managers"ex);
     }
   }
 
   @Override
   protected void onDestroy ()
   {
     // Don't reset the FailedMailQueue, as no global scope is available anymore!
 
     if ( != null)
     {
       AuditUtils.setDefaultAuditor ();
       .stop ();
     }
   }
 
   @Nonnull
   public static MetaSystemManager getInstance ()
   {
     return getGlobalSingleton (MetaSystemManager.class);
  }
  public static AuditManager getAuditMgr ()
  {
    return getInstance ().;
  }
  {
    return getInstance ().;
  }
  {
    return getInstance ().;
  }
  public static ObjectLockManager getLockMgr ()
  {
    return ObjectLockManager.getInstance ();
  }
  {
  }
  {
    return getInstance ().;
  }
New to GrepCode? Check out our FAQ X