Tabnine Logo
Initializable
Code IndexAdd Tabnine to your IDE (free)

How to use
Initializable
in
org.apache.shiro.util

Best Java code snippets using org.apache.shiro.util.Initializable (Showing top 10 results out of 315)

origin: apache/shiro

public static void init(Initializable initializable) throws ShiroException {
  initializable.init();
}
origin: apache/shiro

  public void afterInjection(Initializable injectee) {
    injectee.init();
  }
}
origin: apache/shiro

/**
 * Calls the <tt>init()</tt> methods on the bean if it implements {@link org.apache.shiro.util.Initializable}
 *
 * @param object the object being initialized.
 * @param name   the name of the bean being initialized.
 * @return the initialized bean.
 * @throws BeansException if any exception is thrown during initialization.
 */
public Object postProcessBeforeInitialization(Object object, String name) throws BeansException {
  if (object instanceof Initializable) {
    try {
      if (log.isDebugEnabled()) {
        log.debug("Initializing bean [" + name + "]...");
      }
      ((Initializable) object).init();
    } catch (Exception e) {
      throw new FatalBeanException("Error initializing bean [" + name + "]", e);
    }
  }
  return object;
}
origin: apache/shiro

  @Test
  public void testAfterInjection() throws Exception {
    Initializable initializable = createMock(Initializable.class);

    initializable.init();

    replay(initializable);

    InitializableInjectionListener underTest = new InitializableInjectionListener();
    underTest.afterInjection(initializable);

    verify(initializable);
  }
}
origin: org.apache.shiro/shiro-guice

  public void afterInjection(Initializable injectee) {
    injectee.init();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

public static void init(Initializable initializable) throws ShiroException {
  initializable.init();
}
origin: org.apache.shiro/shiro-lang

public static void init(Initializable initializable) throws ShiroException {
  initializable.init();
}
origin: org.apache.shiro/shiro-spring

/**
 * Calls the <tt>init()</tt> methods on the bean if it implements {@link org.apache.shiro.util.Initializable}
 *
 * @param object the object being initialized.
 * @param name   the name of the bean being initialized.
 * @return the initialized bean.
 * @throws BeansException if any exception is thrown during initialization.
 */
public Object postProcessBeforeInitialization(Object object, String name) throws BeansException {
  if (object instanceof Initializable) {
    try {
      if (log.isDebugEnabled()) {
        log.debug("Initializing bean [" + name + "]...");
      }
      ((Initializable) object).init();
    } catch (Exception e) {
      throw new FatalBeanException("Error initializing bean [" + name + "]", e);
    }
  }
  return object;
}
origin: org.neo4j/neo4j-security-enterprise

@Override
public void init() throws Throwable
{
  for ( Realm realm : realms )
  {
    if ( realm instanceof Initializable )
    {
      ((Initializable) realm).init();
    }
    if ( realm instanceof CachingRealm )
    {
      ((CachingRealm) realm).setCacheManager( cacheManager );
    }
    if ( realm instanceof RealmLifecycle )
    {
      ((RealmLifecycle) realm).initialize();
    }
  }
}
origin: org.sonatype.security/security-system

public void start()
{
  // reload the config
  this.securityConfiguration.clearCache();
  // if we are restarting this component the getCacheManager will be null
  // TODO: need better lifecycle management of cache (done), make sure this works with the NEXUS tests before
  // removing comment
  CacheManager cacheManager = this.cacheManagerComponent.getCacheManager();
  // if( cacheManager == null)
  // {
  // try
  // {
  // cacheManager = this.cacheManagerComponent.buildCacheManager( null );
  // }
  // catch ( IOException e )
  // {
  // throw new IllegalStateException( "Failed to restart CacheManagerComponent" );
  // }
  // }
  // setup the CacheManager ( this could be injected if we where less coupled with ehcache)
  // The plexus wrapper can interpolate the config
  EhCacheManager ehCacheManager = new EhCacheManager();
  ehCacheManager.setCacheManager( cacheManager );
  this.getSecurityManager().setCacheManager( ehCacheManager );
  if ( org.apache.shiro.util.Initializable.class.isInstance( this.getSecurityManager() ) )
  {
    ( (org.apache.shiro.util.Initializable) this.getSecurityManager() ).init();
  }
  this.setSecurityManagerRealms();
}
org.apache.shiro.utilInitializable

Javadoc

Shiro container-agnostic interface that indicates that this object requires initialization.

Most used methods

  • init
    Initializes this object.

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now