congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IoCs
Code IndexAdd Tabnine to your IDE (free)

How to use
IoCs
in
org.apache.sirona.configuration.ioc

Best Java code snippets using org.apache.sirona.configuration.ioc.IoCs (Showing top 20 results out of 315)

origin: org.apache.sirona/sirona-core

public DelegatedCollectorPathTrackingDataStore()
{
  this.delegatedPathTrackingDataStore = IoCs.findOrCreateInstance( PathTrackingDataStore.class );
}
origin: org.apache.sirona/sirona-cube

  public CubeDisruptorDataStoreFactory() {
    super(
      IoCs.processInstance(new CubeCounterDataStore()),
      IoCs.processInstance(new CubeGaugeDataStore()),
      IoCs.processInstance(new CubeNodeStatusDataStore()),
      IoCs.findOrCreateInstance( DisruptorPathTrackingDataStore.class ));
    //  IoCs.processInstance(new DisruptorPathTrackingDataStore())
  }
}
origin: org.apache.sirona/sirona-api

public static <T> T autoSet(final T instance) throws Exception {
  return autoSet(null, instance);
}
origin: org.apache.sirona/sirona-api

  public static boolean isCollector() {
    IoCs.findOrCreateInstance(Repository.class); // ensure we have a repo which init store classes by default
    return IoCs.getInstance(CollectorCounterStore.class) != null;
  }
}
origin: org.apache.sirona/sirona-core

  public DefaultDataStoreFactory() {
    super(
      IoCs.processInstance( new InMemoryCounterDataStore() ), //
      IoCs.processInstance(new InMemoryGaugeDataStore()), //
      IoCs.processInstance(new PeriodicNodeStatusDataStore()), //
      IoCs.processInstance( new InMemoryPathTrackingDataStore() ));
  }
}
origin: org.apache.sirona/sirona-web

  @Override
  public void contextDestroyed(final ServletContextEvent sce) {
    IoCs.shutdown();
  }
}
origin: org.apache.sirona/sirona-api

  method.invoke(instance, convertTo(method.getParameterTypes()[0], value));
} finally {
  if (!acc) {
  field.set(instance, convertTo(field.getType(), value));
} finally {
  if (!acc) {
origin: org.apache.sirona/sirona-cube

  public CubeDataStoreFactory() {
    super(
      IoCs.processInstance(new CubeCounterDataStore()),
      IoCs.processInstance(new CubeGaugeDataStore()),
      IoCs.processInstance(new CubeNodeStatusDataStore()),
      IoCs.processInstance(new CubePathTrackingDataStore()));
  }
}
origin: org.apache.sirona/sirona-api

  @Override
  public void run() {
    shutdown();
  }
};
origin: org.apache.sirona/sirona-core

protected static NodeStatusDataStore findStatusDataStore() {
  NodeStatusDataStore status = null;
  try {
    status = IoCs.findOrCreateInstance(NodeStatusDataStore.class);
  } catch (final SironaException e) {
    // no-op
  }
  if (status == null) {
    status = IoCs.findOrCreateInstance(DataStoreFactory.class).getNodeStatusDataStore();
  }
  return status;
}
origin: org.apache.sirona/sirona-cassandra

  public CassandraCollectorDataStoreFactory() {
    super(
      IoCs.processInstance(new CassandraCollectorCounterDataStore()),
      IoCs.processInstance(new CassandraCollectorGaugeDataStore()),
      IoCs.processInstance(new CassandraCollectorNodeStatusDataStore()),
      IoCs.processInstance(new CassandraPathTrackingDataStore()));
  }
}
origin: org.apache.sirona/sirona-api

public static <T> T autoSet(final String key, final T instance) throws Exception {
  return autoSet(key, instance, instance.getClass());
}
origin: org.apache.sirona/sirona-core

protected static CommonGaugeDataStore findGaugeDataStore() {
  CommonGaugeDataStore gauge = null;
  try {
    gauge = IoCs.findOrCreateInstance(GaugeDataStore.class);
  } catch (final SironaException e) {
    // no-op
  }
  if (gauge == null) {
    try {
      gauge = IoCs.findOrCreateInstance(CollectorGaugeDataStore.class);
    } catch (final SironaException e) {
      // no-op
    }
  }
  if (gauge == null) {
    gauge = IoCs.findOrCreateInstance(DataStoreFactory.class).getGaugeDataStore();
  }
  return gauge;
}
origin: org.apache.sirona/sirona-cassandra

  public CassandraAgentDataStoreFactory() {
    super(
      IoCs.processInstance(new CassandraCounterDataStore()),
      IoCs.processInstance(new CassandraGaugeDataStore()),
      IoCs.processInstance(new CassandraStatusDataStore()),
      IoCs.processInstance(new CassandraPathTrackingDataStore()));
  }
}
origin: org.apache.sirona/sirona-core

protected static Collection<AlertListener> findAlerters() {
  final Collection<AlertListener> listeners = new ArrayList<AlertListener>();
  final String alerters = Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "alerters", null);
  if (alerters != null && alerters.trim().length() > 0) {
    for (final String alert : alerters.split(" *, *")) {
      final String classKey = alert + ".class";
      final String type = Configuration.getProperty(classKey, null);
      if (type == null) {
        throw new IllegalArgumentException("Missing configuration " + classKey);
      }
      try {
        final Class<?> clazz = ClassLoaders.current().loadClass(type);
        final AlertListener listener = IoCs.autoSet(alert, AlertListener.class.cast(clazz.newInstance()));
        listeners.add(listener);
      } catch (final Exception e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
  return listeners;
}
origin: org.apache.sirona/sirona-core

protected static CounterDataStore findCounterDataStore() {
  CounterDataStore counter = null;
  try {
    counter = IoCs.findOrCreateInstance(CounterDataStore.class);
  } catch (final SironaException e) {
    // no-op
  }
  if (counter == null) {
    try {
      counter = IoCs.findOrCreateInstance(CollectorCounterStore.class);
    } catch (final SironaException e) {
      // no-op
    }
  }
  if (counter == null) {
    counter = IoCs.findOrCreateInstance(DataStoreFactory.class).getCounterDataStore();
  }
  return counter;
}
origin: org.apache.sirona/sirona-api

private static <T> T internalProcessInstance(final T instance) throws Exception {
  final Class<?> loadedClass = instance.getClass();
  // autoset before invoking @Created
  if (loadedClass.getAnnotation(AutoSet.class) != null) {
    autoSet(null, instance, loadedClass);
  }
  Class<?> clazz = loadedClass;
  while (clazz != null && !Object.class.equals(clazz)) {
    for (final Method m : clazz.getDeclaredMethods()) {
      if (m.getAnnotation(Created.class) != null) {
        m.setAccessible(true);
        m.invoke(instance);
      } else if (m.getAnnotation(Destroying.class) != null) {
        m.setAccessible(true);
        if (shutdownHook == null == Configuration.is(Configuration.CONFIG_PROPERTY_PREFIX + "shutdown.hook", true)) {
          shutdownHook = new Thread() {
            @Override
            public void run() {
              shutdown();
            }
          };
          Runtime.getRuntime().addShutdownHook(shutdownHook);
        }
        INSTANCES.add(new ToDestroy(m, instance));
      }
    }
    clazz = clazz.getSuperclass();
  }
  return instance;
}
origin: org.apache.sirona/sirona-core

protected static PathTrackingDataStore findPathTrackingDataStore() {
  PathTrackingDataStore pathTrackingDataStore = null;
  try {
    pathTrackingDataStore = IoCs.findOrCreateInstance(PathTrackingDataStore.class);
  } catch (final SironaException e) {
    // no-op
  }
  /**
  FIXME define/implement CollectorPathTrackingDataStore
  if (pathTrackingDataStore == null) {
    try {
      pathTrackingDataStore = IoCs.findOrCreateInstance(CollectorPathTrackingDataStore.class);
    } catch (final SironaException e) {
      // no-op
    }
  }
   */
  if (pathTrackingDataStore == null) {
    pathTrackingDataStore = IoCs.findOrCreateInstance(DataStoreFactory.class).getPathTrackingDataStore();
  }
  return pathTrackingDataStore;
}
origin: org.apache.sirona/sirona-aop

public static <T> T monitor(final Class<T> clazz, final Object instance) {
  return clazz.cast(
    IoCs.findOrCreateInstance(ProxyFactory.class)
      .createInvokerProxy(ClassLoaders.current(), new SironaPerformanceHandler(instance), new Class<?>[]{clazz}));
}
origin: org.apache.sirona/sirona-cassandra

public CassandraCollectorGaugeDataStore() {
  this.cassandra = IoCs.findOrCreateInstance(CassandraSirona.class);
  this.keyspace = cassandra.getKeyspace();
  this.valueFamily = cassandra.getGaugeValuesColumnFamily();
  this.markerFamily = cassandra.getMarkerGaugesColumFamily();
}
org.apache.sirona.configuration.iocIoCs

Most used methods

  • findOrCreateInstance
  • processInstance
  • autoSet
  • shutdown
  • convertTo
  • getInstance
  • internalProcessInstance
  • newInstance
  • setSingletonInstance

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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