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

How to use org.infinispan.marshall

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

origin: stackoverflow.com

 persistenceManager().currentTransaction().begin();
CustomClass customObj = new CustomClass();
customobj.setName("someName");
//set other values    
persistenceManager.makePeristent(customObj);//persist
//comment this
//SomeUtil.getRoot().getChildElements().add(customObj);//add to its owner
persistenceManager.currentTransaction().commit();
origin: stackoverflow.com

 public CustomClass getindexedListobj(int index) {
   CustomClass tmp = null;
   for(CustomClass o : this.listobj)
    if(o.getId() == index) {
     tmp = o;
     break;
    }
   if(tmp == null) {
    tmp = new CustomClass();
    this.listobj.add(tmp);
   }
  return tmp;
}
origin: stackoverflow.com

 CustomClass customClassInstance = new CustomClass();
customClassInstance.setParam1(...);
//...and so on

Call<JsonArray> peticion= RetrofitClient.getRetrofitClient(getActivity()).sendParameters(settings.getString("imei", ""), settings.getString("idCliente", ""), customClassInstance);
origin: org.infinispan/infinispan-core

public void testMarshallingNestedSerializableSubclass() throws Exception {
 Child1 child1Obj = new Child1(1234, "1234");
 Child2 child2Obj = new Child2(2345, "2345", child1Obj);
 byte[] bytes = marshaller.objectToByteBuffer(child2Obj);
 Child2 readChild2 = (Child2) marshaller.objectFromByteBuffer(bytes);
 assertEquals(2345, readChild2.someInt);
 assertEquals("2345", readChild2.getId());
 assertEquals(1234, readChild2.getChild1Obj().someInt);
 assertEquals("1234", readChild2.getChild1Obj().getId());
}
origin: org.infinispan/infinispan-core

public void testTreeSetWithComparator() throws Exception {
 Set<Human> treeSet = new TreeSet<>(new HumanComparator());
 for (int i = 0; i < 10; i++) {
   treeSet.add(new Human().age(i));
 }
 marshallAndAssertEquality(treeSet);
}
origin: org.infinispan/infinispan-core

public void testExternalAndInternalWithOffset() throws Exception {
 PojoWithExternalAndInternal obj = new PojoWithExternalAndInternal(new Human().age(23), "value");
 byte[] bytes = marshaller.objectToByteBuffer(obj);
 bytes = prependBytes(new byte[]{1, 2, 3}, bytes);
 Object readObj = marshaller.objectFromByteBuffer(bytes, 3, bytes.length);
 assertEquals(obj, readObj);
}
origin: org.infinispan/infinispan-core

public void testModificationsOnSameCustomKey() {
 Cache<InvalidatedPojo, String> cache1 = cache(0, "invlSync");
 Cache<InvalidatedPojo, String> cache2 = cache(1, "invlSync");
 InvalidatedPojo key = new InvalidatedPojo();
 cache2.put(key, "1");
 cache1.put(key, "2");
 // Marshalling is done eagerly now, so no need for extra serialization checks
 assertSerializationCounts(2, 0);
 cache1.put(key, "3");
 // +2 carried on here.
 assertSerializationCounts(3, 0);
}
origin: org.infinispan/infinispan-core

private GlobalConfigurationBuilder createMultiForeignExternalizerGlobalConfig(int id, boolean doSetId) {
 GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
 if (doSetId)
   builder.serialization().addAdvancedExternalizer(id, new IdViaConfigObj.Externalizer());
 else
   builder.serialization().addAdvancedExternalizer(new IdViaConfigObj.Externalizer());
 builder.serialization().addAdvancedExternalizer(new IdViaAnnotationObj.Externalizer());
 builder.serialization().addAdvancedExternalizer(3456, new IdViaBothObj.Externalizer());
 return builder;
}
origin: org.infinispan/infinispan-core

protected GlobalConfigurationBuilder createForeignExternalizerGlobalConfig() {
 GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder().clusteredDefault();
 builder.serialization()
   .addAdvancedExternalizer(1234, new IdViaConfigObj.Externalizer())
   .addAdvancedExternalizer(new IdViaAnnotationObj.Externalizer())
   .addAdvancedExternalizer(3456, new IdViaBothObj.Externalizer());
 return builder;
}
origin: org.infinispan/infinispan-core

@Override
protected void createCacheManagers() throws Throwable {
 ConfigurationBuilder builder = getDefaultClusteredCacheConfig(
    CacheMode.REPL_ASYNC, false);
 createClusteredCaches(2, "concurrentMarshaller", builder);
}
origin: org.infinispan/infinispan-core

public void testImmutableResponseMarshalling() throws Exception {
 marshallAndAssertEquality(UnsuccessfulResponse.EMPTY);
 marshallAndAssertEquality(UnsureResponse.INSTANCE);
}
origin: org.infinispan/infinispan-core

public void testByteArray() throws Exception {
 byte[] bytes = new byte[]{1, 2, 3};
 marshallAndAssertByteArrayEquality(bytes);
}
origin: org.infinispan/infinispan-core

  @Override
  public PojoAnnotated readObject(ObjectInput input) throws IOException, ClassNotFoundException {
   return new PojoAnnotated(input.readInt(), input.readBoolean());
  }
}
origin: org.infinispan/infinispan-core

@Override
public PojoWithExternalAndInternal readObject(ObjectInput input) throws IOException, ClassNotFoundException {
 Human human = (Human) input.readObject();
 String value = (String) input.readObject();
 return new PojoWithExternalAndInternal(human, value);
}
origin: stackoverflow.com

List<CustomClass> foo = ArrayList<CustomClass>
  CustomClass cust = new CustomClass();
  cust.setResult("Test");
  cust.setCount(1);
  foo.add(cust);
origin: org.infinispan/infinispan-core

@Override
protected GlobalConfigurationBuilder createForeignExternalizerGlobalConfig() {
 GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder().clusteredDefault();
 builder.serialization()
   .addAdvancedExternalizer(1234, new IdViaConfigObj.Externalizer())
   .addAdvancedExternalizer(new IdViaAnnotationObj.Externalizer())
   .addAdvancedExternalizer(3456, new IdViaBothObj.Externalizer());
 return builder;
}
origin: org.infinispan/infinispan-core

public void testSingleFlagMarshalling() throws Exception {
 marshallAndAssertEquality(Flag.FORCE_SYNCHRONOUS);
}
origin: stackoverflow.com

 class CustomClassJsFactory : public QObject
{
  Q_OBJECT
public:
 CustomClassFactory(QJSEngine* engine) : m_engine(engine) {}
 Q_INVOKABLE QJSValue createInstance() {
   // The engine takes ownership and destroys the object if no longer required.
   return m_engine->newQObject(new CustomClass());
 }
private:
  QJSEngine* m_engine;
}
origin: org.infinispan/infinispan-core

public void testConcurrentHashMap() throws Exception {
 ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>();
 map.put(1, "v1");
 map.put(2, "v2");
 map.put(3, "v3");
 marshallAndAssertEquality(map);
}
origin: stackoverflow.com

 public class MyClass_ extends MyClass {

  private CustomClass member;

  public synchronized CustomClass getMember() {
    if (member == null){
      member == new CustomClass();
    }
    return member;
  }
}
org.infinispan.marshall

Most used classes

  • MarshalledEntry
  • MarshalledEntryFactory
  • MarshalledEntryImpl
  • TestObjectStreamMarshaller
    A dummy marshaller impl. Under the hood instantiates an StreamingMarshaller. N.B.: When an instance
  • StreamingMarshaller
    A specialization of Marshaller that supports streams. A single instance of any implementation is sha
  • CustomClass,
  • GlobalMarshaller,
  • MarshalledEntryFactoryImpl,
  • User,
  • AdvancedExternalizerQuickConfigTest,
  • AdvancedExternalizerTest$IdViaAnnotationObj$Externalizer,
  • AdvancedExternalizerTest$IdViaAnnotationObj,
  • AdvancedExternalizerTest$IdViaBothObj$Externalizer,
  • AdvancedExternalizerTest$IdViaBothObj,
  • AdvancedExternalizerTest$IdViaConfigObj$Externalizer,
  • AdvancedExternalizerTest$IdViaConfigObj,
  • AdvancedExternalizerTest,
  • ConcurrentMarshallerTest$CacheUpdater,
  • ConcurrentMarshallerTest
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