Codota Logo
BeanLocator
Code IndexAdd Codota to your IDE (free)

How to use
BeanLocator
in
org.apache.batchee.extras.locator

Best Java code snippets using org.apache.batchee.extras.locator.BeanLocator (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.apache.batchee/batchee-extras

@Override
public void open(final Serializable checkpoint) throws Exception {
  mapper = BeanLocator.Finder.get(locator).newInstance(RecordMapper.class, mapperStr);
  items = new LinkedList<Object>();
}
origin: org.apache.batchee/batchee-extras

@Override
public void open(final Serializable checkpoint) throws Exception {
  mapper = BeanLocator.Finder.get(locator).newInstance(ObjectMapper.class, mapperStr);
}
origin: org.apache.batchee/batchee-camel

private static BeanLocator.LocatorInstance<CamelTemplateLocator> locator(final String locator) {
  if (locator == null) {
    return new BeanLocator.LocatorInstance<CamelTemplateLocator>(DefaultCamelTemplateLocator.INSTANCE, null);
  }
  return BeanLocator.Finder.get(locator).newInstance(CamelTemplateLocator.class, locator);
}
origin: org.apache.batchee/batchee-extras

@Override
public void open(final Serializable checkpoint) throws Exception {
  final BeanLocator beanLocator = BeanLocator.Finder.get(locator);
  emProvider = findEntityManager();
  if (parameterProvider != null) {
    paramProvider = beanLocator.newInstance(ParameterProvider.class, parameterProvider);
  }
  if (pageSize != null) {
    page = Integer.parseInt(pageSize, page);
  }
  if (namedQuery == null && query == null) {
    throw new BatchRuntimeException("a query should be provided");
  }
  detach = Boolean.parseBoolean(detachEntities);
  transaction = Boolean.parseBoolean(jpaTransaction);
}
origin: org.apache.batchee/batchee-extras

protected ItemProcessor getDelegate() { // note with cdi delegate scope shouldn't need cleanup
  if (delegate == null) {
    delegate = BeanLocator.Finder.get(locator).newInstance(ItemProcessor.class, delegateRef).getValue();
  }
  return delegate;
}
origin: org.apache.batchee/batchee-extras

protected BeanLocator.LocatorInstance<EntityManagerProvider> findEntityManager() {
  if (entityManagerProvider != null && entityManagerProvider.startsWith("jndi:")) {
    return new BeanLocator.LocatorInstance<EntityManagerProvider>(new JndiEntityManagerProvider(entityManagerProvider.substring("jndi:".length())), null);
  }
  return BeanLocator.Finder.get(locator).newInstance(EntityManagerProvider.class, entityManagerProvider);
}
origin: org.apache.batchee/batchee-commons-csv

@Override
public void open(final Serializable checkpoint) throws Exception {
  final CsvWriterMapper defaultMapper = mapping != null ? new DefaultMapper(Thread.currentThread().getContextClassLoader().loadClass(mapping)) : null;
  mapperInstance = mapper == null ?
    (defaultMapper != null ? new BeanLocator.LocatorInstance<CsvWriterMapper>(defaultMapper, null) : null) :
    BeanLocator.Finder.get(locator).newInstance(CsvWriterMapper.class, mapper);
  if ((header == null || header.isEmpty()) && Boolean.parseBoolean(writeHeaders) && DefaultMapper.class.isInstance(mapperInstance.getValue()) && checkpoint == null) {
    header = toListString(DefaultMapper.class.cast(mapperInstance.getValue()).getHeaders());
  }
  final CSVFormat format = newFormat();
  final File file = new File(output);
  if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
    throw new IllegalStateException("Cant create " + file);
  }
  this.transactionalWriter = new TransactionalWriter(file, encoding, checkpoint);
  this.writer = format.print(transactionalWriter);
}
origin: org.apache.batchee/batchee-extras

@Override
public void open(final Serializable checkpoint) throws Exception {
  if (input == null) {
    throw new BatchRuntimeException("Can't find any input");
  }
  final File file = new File(input);
  if (!file.exists()) {
    throw new BatchRuntimeException("'" + input + "' doesn't exist");
  }
  if (lineMapper != null) {
    mapper = BeanLocator.Finder.get(locator).newInstance(LineMapper.class, lineMapper);
  } else {
    mapper = null;
  }
  if (commentStr == null) {
    commentStr = "#";
  }
  comments = commentStr.split(",");
  reader = new BufferedReader(new FileReader(file));
  super.open(checkpoint);
}
origin: org.apache.batchee/batchee-extras

public Object runChain(final Object item) throws Exception {
  if (chain == null) {
    return item;
  }
  if (separator == null) {
    separator = ",";
  }
  if (runtimeChain.isEmpty()) {
    final BeanLocator beanLocator = getBeanLocator();
    final Class<T> type = findType();
    for (final String next : chain.split(separator)) {
      runtimeChain.add(beanLocator.newInstance(type, next));
    }
  }
  Object current = item;
  for (final BeanLocator.LocatorInstance<T> next : runtimeChain) {
    current = invoke(next, current);
  }
  if (Boolean.parseBoolean(forceRelease)) {
    for (final BeanLocator.LocatorInstance<?> next : runtimeChain) {
      next.release();
    }
    runtimeChain.clear();
  }
  return current;
}
origin: org.apache.batchee/batchee-commons-csv

@Override
public void open(final Serializable checkpoint) throws Exception {
  final CSVFormat csvFormat = newFormat();
  parser = csvFormat.parse(newReader());
  iterator = new IteratorReader<CSVRecord>(parser.iterator());
  mapperInstance = mapper == null ?
    new BeanLocator.LocatorInstance<CsvReaderMapper>(
      mapping != null ? new DefaultMapper(Thread.currentThread().getContextClassLoader().loadClass(mapping)) : NOOP_MAPPER, null) :
    BeanLocator.Finder.get(locator).newInstance(CsvReaderMapper.class, mapper);
  super.open(checkpoint);
}
org.apache.batchee.extras.locatorBeanLocator

Most used methods

  • newInstance

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • startActivity (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now