本文整理汇总了Java中com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer类的典型用法代码示例。如果您正苦于以下问题:Java ReflectionBasedAutoSerializer类的具体用法?Java ReflectionBasedAutoSerializer怎么用?Java ReflectionBasedAutoSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReflectionBasedAutoSerializer类属于com.gemstone.gemfire.pdx包,在下文中一共展示了ReflectionBasedAutoSerializer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: instantiatePdxSerializer
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
/** Method used by hydra to return a properly configured instance of PdxSerializer
*
* @return An instance of PdxSerializer to be set in the cache.
*/
public static PdxSerializer instantiatePdxSerializer() {
String className = PdxPrms.getPdxSerializerClassName();
if (className.equals(ReflectionBasedAutoSerializer.class.getName())) {
List<String> aList = new ArrayList();
aList.add("util.VersionedValueHolder#identity=myValue");
aList.add(".*");
ReflectionBasedAutoSerializer mySerializer = new ReflectionBasedAutoSerializer(aList);
Log.getLogWriter().info("Created " + mySerializer.getClass().getName() + " with args: " + aList);
return mySerializer;
} else if (className.equals(PdxTestSerializer.class.getName())) {
Log.getLogWriter().info("Created " + PdxTestSerializer.class.getName());
return new PdxTestSerializer();
} else {
throw new TestException("Test problem: don't know about " + className);
}
}
示例2: insertAWholeBunch
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
@Test
public void insertAWholeBunch() throws JsonProcessingException {
ClientCacheFactory factory = new ClientCacheFactory();
factory.set("security-client-auth-init", "io.pivotal.gemfire.demo.ClientAuthentication.create");
factory.set("security-username", "super-user");
factory.set("security-password", "1234567");
factory.addPoolLocator("localhost", 10334);
factory.setPdxSerializer(new ReflectionBasedAutoSerializer("demo.geode.greenplum.*"));
ClientCache clientCache = factory.create();
Region testRegion = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("Region1");
int counter = 1;
ObjectMapper objectMapper = new ObjectMapper();
while (true) {
SampleData sampleData = new SampleData(counter++, new Date(), "some text" + counter++, counter % 2 == 0);
String json = objectMapper.writeValueAsString(sampleData);
testRegion.put(counter, JSONFormatter.fromJSON(json));
}
}
示例3: setPdxSerializer
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public static void setPdxSerializer(PdxSerializer v) {
if (v == null) {
PdxSerializer oldValue = pdxSerializer.getAndSet(null);
if (oldValue instanceof ReflectionBasedAutoSerializer) {
asm.compareAndSet(AutoSerializableManager.getInstance((ReflectionBasedAutoSerializer) oldValue), null);
}
} else {
pdxSerializerWasSet = true;
pdxSerializer.set(v);
if (v instanceof ReflectionBasedAutoSerializer) {
asm.set(AutoSerializableManager.getInstance((ReflectionBasedAutoSerializer) v));
}
}
}
示例4: samePdxSerializer
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
private boolean samePdxSerializer(PdxSerializer s1, PdxSerializer s2) {
Object o1 = s1;
Object o2 = s2;
if (s1 instanceof ReflectionBasedAutoSerializer && s2 instanceof ReflectionBasedAutoSerializer) {
// Fix for bug 44907.
o1 = AutoSerializableManager.getInstance((ReflectionBasedAutoSerializer) s1);
o2 = AutoSerializableManager.getInstance((ReflectionBasedAutoSerializer) s2);
}
return equals(o1, o2);
}
示例5: generate
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
/**
* Generates XML for a <code>CacheCallback</code>
*/
private void generate(String kind, Object callback)
throws SAXException {
if (callback == null) {
return;
}
handler.startElement("", kind, kind, EMPTY);
String className = callback.getClass().getName();
handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY);
handler.characters(className.toCharArray(), 0, className.length());
handler.endElement("", CLASS_NAME, CLASS_NAME);
Properties props = null;
if (callback instanceof Declarable2) {
props = ((Declarable2) callback).getConfig();
} else if (callback instanceof BridgeWriter) {
props = ((BridgeWriter) callback).getProperties();
} else if (callback instanceof BridgeLoader) {
props = ((BridgeLoader) callback).getProperties();
} else if (callback instanceof ReflectionBasedAutoSerializer) {
props = ((ReflectionBasedAutoSerializer) callback).getConfig();
} else if (callback instanceof Declarable && cache instanceof GemFireCacheImpl) {
props = ((GemFireCacheImpl) cache).getDeclarableProperties((Declarable) callback);
}
generate(props, null);
handler.endElement("", kind, kind);
}
示例6: basicSetPdxSerializer
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
private void basicSetPdxSerializer(PdxSerializer v) {
TypeRegistry.setPdxSerializer(v);
if (v instanceof ReflectionBasedAutoSerializer) {
AutoSerializableManager asm = AutoSerializableManager.getInstance((ReflectionBasedAutoSerializer) v);
if (asm != null) {
asm.setRegionService(this);
}
}
}
示例7: instantiatePdxSerializer
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public static PdxSerializer instantiatePdxSerializer() {
List<String> l = new ArrayList();
l.add("objects.PdxObject#identity=timestamp#identity=field1#identity=field2");
ReflectionBasedAutoSerializer pdx = new ReflectionBasedAutoSerializer(l);
Log.getLogWriter().info("Created PDX serializer " + pdx.getClass().getName() + " with args: " + l);
return pdx;
}
示例8: test007Bug44907
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public void test007Bug44907() {
new ClientCacheFactory()
.setPdxSerializer(new ReflectionBasedAutoSerializer())
.create();
new ClientCacheFactory()
.setPdxSerializer(new ReflectionBasedAutoSerializer())
.create();
}
示例9: getOwner
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public ReflectionBasedAutoSerializer getOwner() {
return this.owner;
}
示例10: create
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public static AutoSerializableManager create(ReflectionBasedAutoSerializer owner, boolean checkPortability, String... patterns) {
AutoSerializableManager result = new AutoSerializableManager(owner);
result.reconfigure(checkPortability, patterns);
instances.put(owner, result);
return result;
}
示例11: AutoSerializableManager
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
private AutoSerializableManager(ReflectionBasedAutoSerializer owner) {
this.owner = owner;
}
示例12: getInstance
import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer; //导入依赖的package包/类
public static AutoSerializableManager getInstance(ReflectionBasedAutoSerializer owner) {
return instances.get(owner);
}