Tabnine Logo
org.infinispan.persistence.spi
Code IndexAdd Tabnine to your IDE (free)

How to use org.infinispan.persistence.spi

Best Java code snippets using org.infinispan.persistence.spi (Showing top 20 results out of 315)

origin: wildfly/wildfly

private Object unmarshall(byte[] bytes) {
  try {
    return this.ctx.getMarshaller().objectFromByteBuffer(bytes);
  } catch (IOException | ClassNotFoundException e) {
    throw new PersistenceException(e);
  }
}
origin: wildfly/wildfly

@Override
public Connection getConnection() throws PersistenceException {
  try {
    return this.factory.getConnection();
  } catch (SQLException e) {
    throw new PersistenceException(e);
  }
}
origin: wildfly/wildfly

private MarshalledEntry<K, V> asMarshalledEntry(Object key) {
  return this.ctx.getMarshalledEntryFactory().newMarshalledEntry(key, (Object) null, (InternalMetadata) null);
}
origin: wildfly/wildfly

@Override
public void init(InitializationContext ctx) {
  this.ctx = ctx;
  HotRodStoreConfiguration configuration = ctx.getConfiguration();
  RemoteCacheContainer remoteCacheContainer = configuration.attributes().attribute(HotRodStoreConfiguration.REMOTE_CACHE_CONTAINER).get();
  String cacheConfiguration = configuration.attributes().attribute(HotRodStoreConfiguration.CACHE_CONFIGURATION).get();
  String cacheName = ctx.getCache().getName();
  try {
    ProtocolVersion protocolVersion = remoteCacheContainer.getConfiguration().version();
    // Administration support was introduced in protocol version 2.7
    if (protocolVersion.compareTo(ProtocolVersion.PROTOCOL_VERSION_27) < 0) {
      this.remoteCache = remoteCacheContainer.getCache(cacheName, false);
      if (this.remoteCache == null) {
        throw InfinispanLogger.ROOT_LOGGER.remoteCacheMustBeDefined(protocolVersion.toString(), cacheName);
      }
    } else {
      InfinispanLogger.ROOT_LOGGER.remoteCacheCreated(cacheName, cacheConfiguration);
      this.remoteCache = remoteCacheContainer.administration().getOrCreateCache(cacheName, cacheConfiguration);
    }
  } catch (HotRodClientException ex) {
    throw new PersistenceException(ex);
  }
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public void init(InitializationContext initializationContext) {
 configuration = initializationContext.getConfiguration();
 ctx = initializationContext;
}
origin: org.infinispan/infinispan-core

@Override
public void init(InitializationContext ctx) {
  factory = ctx.getMarshalledEntryFactory();
  timeService = ctx.getTimeService();
}
origin: org.infinispan/infinispan-cachestore-rocksdb

private Object unmarshall(byte[] bytes) throws IOException, ClassNotFoundException {
  if (bytes == null)
    return null;
  return ctx.getMarshaller().objectFromByteBuffer(bytes);
}
origin: org.infinispan/infinispan-cachestore-jpa

  @Override
  public void run() {
   listener.entryPurged(key);
  }
}, null);
origin: org.infinispan/infinispan-core

protected void verifyNoDataOnLoader(Cache<Object, Object> c) throws Exception {
 CacheLoader l = TestingUtil.getFirstLoader(c);
 assert !l.contains(A_B_AGE);
 assert !l.contains(A_B_NAME);
 assert !l.contains(A_C_AGE);
 assert !l.contains(A_C_NAME);
 assert !l.contains(A_D_AGE);
 assert !l.contains(A_D_NAME);
}
origin: wildfly/wildfly

private byte[] marshall(Object key) {
  try {
    return (key instanceof WrappedByteArray) ? ((WrappedByteArray) key).getBytes() : this.ctx.getMarshaller().objectToByteBuffer(key);
  } catch (IOException | InterruptedException e) {
    throw new PersistenceException(e);
  }
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
  throw new PersistenceException(cause);
}
origin: org.infinispan.server/infinispan-server-testsuite

@Override
public void init(InitializationContext ctx) {
  this.config = ctx.getConfiguration();
}
origin: wildfly/wildfly

@Override
public MarshalledEntry<K, V> load(Object key) throws PersistenceException {
  byte[] bytes = this.remoteCache.get(this.marshall(key));
  if (bytes == null) {
    return null;
  }
  Map.Entry<ByteBuffer, ByteBuffer> entry = this.unmarshallValue(bytes);
  return this.ctx.getMarshalledEntryFactory().newMarshalledEntry(key, entry.getKey(), entry.getValue());
}
origin: org.infinispan/infinispan-core

public static void verifyNoDataOnLoader(Cache<Object, Object> c) throws Exception {
 CacheLoader l = TestingUtil.getFirstLoader(c);
 assert !l.contains(A_B_AGE);
 assert !l.contains(A_B_NAME);
 assert !l.contains(A_C_AGE);
 assert !l.contains(A_C_NAME);
 assert !l.contains(A_D_AGE);
 assert !l.contains(A_D_NAME);
}
origin: org.wildfly/wildfly-clustering-infinispan-extension

private Object unmarshall(byte[] bytes) {
  try {
    return this.ctx.getMarshaller().objectFromByteBuffer(bytes);
  } catch (IOException | ClassNotFoundException e) {
    throw new PersistenceException(e);
  }
}
origin: org.infinispan/infinispan-cachestore-jdbc

@Override
public Connection getConnection() throws PersistenceException {
 try {
   Connection connection = DriverManager.getConnection(connectionUrl, userName, password);
   if (connection == null)
    throw new PersistenceException("Received null connection from the DriverManager!");
   connectionCount++;
   return connection;
 } catch (SQLException e) {
   throw new PersistenceException("Could not obtain a new connection", e);
 }
}
origin: org.infinispan/infinispan-embedded-query

@Override
public void init(InitializationContext ctx) {
 this.ctx = ctx;
 LuceneLoaderConfiguration configuration = ctx.getConfiguration();
 this.fileRoot = configuration.location();
 this.autoChunkSize = configuration.autoChunkSize();
 this.affinitySegmentId = configuration.affinitySegmentId();
}
origin: org.wildfly/wildfly-clustering-infinispan-extension

private byte[] marshall(Object key) {
  try {
    return (key instanceof WrappedByteArray) ? ((WrappedByteArray) key).getBytes() : this.ctx.getMarshaller().objectToByteBuffer(key);
  } catch (IOException | InterruptedException e) {
    throw new PersistenceException(e);
  }
}
origin: org.infinispan/infinispan-tools

  private Map<Object, MarshalledEntry> unmarshallBucketEntries(InputStream inputStream) {
   try {
     return (Map<Object, MarshalledEntry>) marshaller.objectFromInputStream(inputStream);
   } catch (IOException e) {
     throw new PersistenceException("I/O error while unmarshalling from stream", e);
   } catch (ClassNotFoundException e) {
     throw new PersistenceException(e);
   }
  }
}
origin: org.infinispan/infinispan-core

  private void assertRunning() {
   if (!running)
     throw new IllegalLifecycleStateException();

   if (!available)
     throw new PersistenceException();
  }
}
org.infinispan.persistence.spi

Most used classes

  • InitializationContext
  • PersistenceException
  • AdvancedCacheWriter$PurgeListener
  • AdvancedCacheLoader$CacheLoaderTask
  • AdvancedLoadWriteStore
  • AdvancedCacheExpirationWriter$ExpirationPurgeListener,
  • CacheLoader,
  • SegmentedAdvancedLoadWriteStore,
  • AdvancedCacheExpirationWriter,
  • AdvancedCacheLoader$KeyFilter,
  • AdvancedCacheLoader,
  • AdvancedCacheWriter,
  • CacheWriter
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