Tabnine Logo
GuiceHelper.getGuiceInjector
Code IndexAdd Tabnine to your IDE (free)

How to use
getGuiceInjector
method
in
com.walterjwhite.google.guice.GuiceHelper

Best Java code snippets using com.walterjwhite.google.guice.GuiceHelper.getGuiceInjector (Showing top 5 results out of 315)

origin: com.walterjwhite.infrastructure.google-guice.modules/guava-event-bus

protected void doRegister(Object e, final boolean isAsync) {
 if (isAsync) GuiceHelper.getGuiceInjector().getInstance(AsyncEventBus.class).register(e);
 else GuiceHelper.getGuiceInjector().getInstance(EventBus.class).register(e);
 LOGGER.info("registered:" + e.toString() + " as " + isAsync);
}
origin: com.walterjwhite.infrastructure.google-guice.modules/guava-event-bus

public void register(Object instance, final boolean isAsync) {
 try {
  GuiceHelper.getGuiceInjector();
  doRegister(instance, isAsync);
 } catch (Exception e) {
  LOGGER.warn("not yet initialized");
  if (isAsync) asyncInstances.add(new WeakReference(instance));
  else syncInstances.add(new WeakReference(instance));
 }
}
origin: com.walterjwhite.infrastructure.google-guice.modules/property

private static void doStartService(final Class<? extends Service> serviceClass) {
 try {
  final Service service = GuiceHelper.getGuiceInjector().getInstance(serviceClass);
  if (!service.isRunning()) service.startAsync();
  else LOGGER.debug("service was already started, perhaps because it is an eager singleton?");
 } catch (ConfigurationException e) {
  LOGGER.warn("Service may NOT be a Guice service, check configuration", e);
 }
}
origin: com.walterjwhite.infrastructure.google-guice.modules/cli

protected void doRunInternal() throws Exception {
 abstractCommandLineHandler =
   GuiceHelper.getGuiceInjector().getInstance(getCommandLineHandlerClass());
 if (CommandLineDaemon.class.isAssignableFrom(abstractCommandLineHandler.getClass())) {
  doRunDaemon(abstractCommandLineHandler);
 } else abstractCommandLineHandler.run(arguments);
}
origin: com.walterjwhite.infrastructure.google-guice.modules/property

 private static void doStopService(final Class<? extends Service> serviceClass) {
  try {
   final Service service = GuiceHelper.getGuiceInjector().getInstance(serviceClass);
   if (service.isRunning())
    service
      .stopAsync()
      .awaitTerminated(
        Long.valueOf(PropertyUtil.getValue(null, ServiceStopTimeout.class)),
        TimeUnit.SECONDS);
   else LOGGER.warn("Service:" + service + " is already stopped.");
  } catch (TimeoutException | IllegalStateException e) {
   LOGGER.warn("Service is still stopping, killing.");
  }
 }
}
com.walterjwhite.google.guiceGuiceHelpergetGuiceInjector

Popular methods of GuiceHelper

  • addModule
  • setup

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Reference (javax.naming)
  • Top Sublime Text plugins
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