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

How to use
IOUtils
in
org.axonframework.common.io

Best Java code snippets using org.axonframework.common.io.IOUtils (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: AxonFramework/AxonFramework

/**
 * Shut down this processor. This will deregister the processor with the {@link EventBus}.
 */
@Override
public void shutDown() {
  IOUtils.closeQuietly(eventBusRegistration);
  eventBusRegistration = null;
}
origin: AxonFramework/AxonFramework

/**
 * Closes any object if that object implements {@link AutoCloseable}, while suppressing any IOExceptions it will
 * generate. The given {@code closeable} may be {@code null}, in which case nothing happens.
 *
 * @param closeable the object to be closed
 */
public static void closeQuietlyIfCloseable(Object closeable) {
  if (closeable instanceof AutoCloseable) {
    closeQuietly((AutoCloseable) closeable);
  }
}
origin: AxonFramework/AxonFramework

/**
 * Method to invoke when the application shuts down. This closes all event streams used for event store tracking.
 */
@PreDestroy
public void shutDown() {
  tailingConsumers.forEach(IOUtils::closeQuietly);
  IOUtils.closeQuietly(producer);
  cleanupService.shutdownNow();
}
origin: AxonFramework/AxonFramework

  private Properties loadDefaultPropertyFile() {
    Properties properties = new Properties();
    InputStream resources = null;
    try {
      resources = SQLErrorCodesResolver.class.getResourceAsStream(SQL_ERROR_CODES_PROPERTIES);
      properties.load(resources);
    } catch (IOException e) {
      throw new AxonConfigurationException("Unable to read from a file that should be ", e);
    } finally {
      IOUtils.closeQuietly(resources);
    }
    return properties;
  }
}
origin: AxonFramework/AxonFramework

/**
 * Initialize the RevisionResolver to look for the version in the Meta Data of the artifact with given
 * {@code groupId} and {@code artifactId}.
 *
 * @param groupId     The groupId as defined in the pom.xml file of the module
 * @param artifactId  The artifactId as defined in the pom.xml file of the module
 * @param classLoader The class loader to load the artifact configuration with
 * @throws IOException When an exception occurs reading from the maven configuration file
 */
public MavenArtifactRevisionResolver(String groupId, String artifactId, ClassLoader classLoader)
    throws IOException {
  final InputStream propFile = classLoader.getResourceAsStream(
      "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties");
  if (propFile != null) {
    try {
      Properties mavenProps = new Properties();
      mavenProps.load(propFile);
      version = mavenProps.getProperty("version");
    } finally {
      closeQuietly(propFile);
    }
  } else {
    version = null;
  }
}
origin: AxonFramework/AxonFramework

@After
public void tearDown() {
  closeQuietly(connection);
}
origin: AxonFramework/AxonFramework

@SuppressWarnings("unchecked")
@Override
public <S, T> T deserialize(SerializedObject<S> serializedObject) {
  if (SerializedType.emptyType().equals(serializedObject.getType())) {
    return null;
  }
  if (UnknownSerializedType.class.isAssignableFrom(classForType(serializedObject.getType()))) {
    return (T) new UnknownSerializedType(this, serializedObject);
  }
  SerializedObject<InputStream> converted =
      converter.convert(serializedObject, InputStream.class);
  ObjectInputStream ois = null;
  try {
    ois = new ObjectInputStream(converted.getData());
    return (T) ois.readObject();
  } catch (ClassNotFoundException | IOException e) {
    throw new SerializationException("An error occurred while deserializing: " + e.getMessage(), e);
  } finally {
    IOUtils.closeQuietly(ois);
  }
}
origin: AxonFramework/AxonFramework

    closeQuietly(eventStream);
    eventStream = null;
    doSleepFor(SECONDS.toMillis(errorWaitTime));
closeQuietly(eventStream);
releaseToken(segment);
origin: org.axonframework/axon-core

/**
 * Closes any object if that object implements {@link AutoCloseable}, while suppressing any IOExceptions it will
 * generate. The given {@code closeable} may be {@code null}, in which case nothing happens.
 *
 * @param closeable the object to be closed
 */
public static void closeQuietlyIfCloseable(Object closeable) {
  if (closeable instanceof AutoCloseable) {
    closeQuietly((AutoCloseable) closeable);
  }
}
origin: org.axonframework/axon-messaging

/**
 * Closes any object if that object implements {@link AutoCloseable}, while suppressing any IOExceptions it will
 * generate. The given {@code closeable} may be {@code null}, in which case nothing happens.
 *
 * @param closeable the object to be closed
 */
public static void closeQuietlyIfCloseable(Object closeable) {
  if (closeable instanceof AutoCloseable) {
    closeQuietly((AutoCloseable) closeable);
  }
}
origin: org.axonframework/axon-core

  /**
   * Shut down this processor. This will deregister the processor with the {@link EventBus}.
   */
  @Override
  public void shutDown() {
    IOUtils.closeQuietly(eventBusRegistration);
    eventBusRegistration = null;
  }
}
origin: org.axonframework/axon-messaging

/**
 * Shut down this processor. This will deregister the processor with the {@link EventBus}.
 */
@Override
public void shutDown() {
  IOUtils.closeQuietly(eventBusRegistration);
  eventBusRegistration = null;
}
origin: org.axonframework/axon-core

/**
 * Method to invoke when the application shuts down. This closes all event streams used for event store tracking.
 */
@PreDestroy
public void shutDown() {
  tailingConsumers.forEach(IOUtils::closeQuietly);
  IOUtils.closeQuietly(producer);
  cleanupService.shutdownNow();
}
origin: org.axonframework/axon-eventsourcing

/**
 * Method to invoke when the application shuts down. This closes all event streams used for event store tracking.
 */
@PreDestroy
public void shutDown() {
  tailingConsumers.forEach(IOUtils::closeQuietly);
  IOUtils.closeQuietly(producer);
  cleanupService.shutdownNow();
}
origin: org.axonframework/axon-eventsourcing

  private Properties loadDefaultPropertyFile() {
    Properties properties = new Properties();
    InputStream resources = null;
    try {
      resources = SQLErrorCodesResolver.class.getResourceAsStream(SQL_ERROR_CODES_PROPERTIES);
      properties.load(resources);
    } catch (IOException e) {
      throw new AxonConfigurationException("Unable to read from a file that should be ", e);
    } finally {
      IOUtils.closeQuietly(resources);
    }
    return properties;
  }
}
origin: org.axonframework/axon-core

  private Properties loadDefaultPropertyFile() {
    Properties properties = new Properties();
    InputStream resources = null;
    try {
      resources = SQLErrorCodesResolver.class.getResourceAsStream(SQL_ERROR_CODES_PROPERTIES);
      properties.load(resources);
    } catch (IOException e) {
      throw new AxonConfigurationException("Unable to read from a file that should be ", e);
    } finally {
      IOUtils.closeQuietly(resources);
    }
    return properties;
  }
}
origin: org.axonframework/axon-core

/**
 * Initialize the RevisionResolver to look for the version in the Meta Data of the artifact with given
 * {@code groupId} and {@code artifactId}.
 *
 * @param groupId     The groupId as defined in the pom.xml file of the module
 * @param artifactId  The artifactId as defined in the pom.xml file of the module
 * @param classLoader The class loader to load the artifact configuration with
 * @throws IOException When an exception occurs reading from the maven configuration file
 */
public MavenArtifactRevisionResolver(String groupId, String artifactId, ClassLoader classLoader)
    throws IOException {
  final InputStream propFile = classLoader.getResourceAsStream(
      "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties");
  if (propFile != null) {
    try {
      Properties mavenProps = new Properties();
      mavenProps.load(propFile);
      version = mavenProps.getProperty("version");
    } finally {
      closeQuietly(propFile);
    }
  } else {
    version = null;
  }
}
origin: org.axonframework/axon-messaging

/**
 * Initialize the RevisionResolver to look for the version in the Meta Data of the artifact with given
 * {@code groupId} and {@code artifactId}.
 *
 * @param groupId     The groupId as defined in the pom.xml file of the module
 * @param artifactId  The artifactId as defined in the pom.xml file of the module
 * @param classLoader The class loader to load the artifact configuration with
 * @throws IOException When an exception occurs reading from the maven configuration file
 */
public MavenArtifactRevisionResolver(String groupId, String artifactId, ClassLoader classLoader)
    throws IOException {
  final InputStream propFile = classLoader.getResourceAsStream(
      "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties");
  if (propFile != null) {
    try {
      Properties mavenProps = new Properties();
      mavenProps.load(propFile);
      version = mavenProps.getProperty("version");
    } finally {
      closeQuietly(propFile);
    }
  } else {
    version = null;
  }
}
origin: org.axonframework/axon-core

@SuppressWarnings("unchecked")
@Override
public <S, T> T deserialize(SerializedObject<S> serializedObject) {
  if (SerializedType.emptyType().equals(serializedObject.getType())) {
    return null;
  }
  SerializedObject<InputStream> converted =
      converter.convert(serializedObject, InputStream.class);
  ObjectInputStream ois = null;
  try {
    ois = new ObjectInputStream(converted.getData());
    return (T) ois.readObject();
  } catch (ClassNotFoundException | IOException e) {
    throw new SerializationException("An error occurred while deserializing: " + e.getMessage(), e);
  } finally {
    IOUtils.closeQuietly(ois);
  }
}
origin: org.axonframework/axon-messaging

@SuppressWarnings("unchecked")
@Override
public <S, T> T deserialize(SerializedObject<S> serializedObject) {
  if (SerializedType.emptyType().equals(serializedObject.getType())) {
    return null;
  }
  if (UnknownSerializedType.class.isAssignableFrom(classForType(serializedObject.getType()))) {
    return (T) new UnknownSerializedType(this, serializedObject);
  }
  SerializedObject<InputStream> converted =
      converter.convert(serializedObject, InputStream.class);
  ObjectInputStream ois = null;
  try {
    ois = new ObjectInputStream(converted.getData());
    return (T) ois.readObject();
  } catch (ClassNotFoundException | IOException e) {
    throw new SerializationException("An error occurred while deserializing: " + e.getMessage(), e);
  } finally {
    IOUtils.closeQuietly(ois);
  }
}
org.axonframework.common.ioIOUtils

Javadoc

Utility methods for IO operations.

Most used methods

  • closeQuietly
    Closes any AutoCloseable object, while suppressing any IOExceptions it will generate. The given clos

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JComboBox (javax.swing)
  • Join (org.hibernate.mapping)
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