@Nonnull public static BufferObjectDataInput createObjectDataInput(@Nonnull NodeEngine engine, @Nonnull byte[] buf) { return ((InternalSerializationService) engine.getSerializationService()) .createObjectDataInput(buf); }
@Override public BufferObjectDataOutput takeOutputBuffer() { BufferObjectDataOutput out = outputQueue.poll(); if (out == null) { out = serializationService.createObjectDataOutput(); } return out; }
@Override protected ClientMessage encodeResponse(Object response) { Data data = serializationService.toData(response); return DurableExecutorRetrieveResultCodec.encodeResponse(data); }
private V resolve(Object object) { // if there is an explicit value set, we use that if (result != null) { return (V) result; } // if there already is a deserialized value set, use it. if (deserializedValue != VOID) { return (V) deserializedValue; } if (object instanceof Data) { // we need to deserialize. Data data = (Data) object; object = serializationService.toObject(data); //todo do we need to call dispose data here serializationService.disposeData(data); // now we need to try to set the value for other users. for (; ; ) { Object current = deserializedValue; if (current != VOID) { object = current; break; } else if (DESERIALIZED_VALUE.compareAndSet(this, VOID, object)) { break; } } } return (V) object; }
@Override protected Object innerCall() throws Exception { final TransactionContext context = endpoint.getTransactionContext(parameters.txnId); final TransactionalMap map = context.getMap(parameters.name); Predicate predicate = serializationService.toObject(parameters.predicate); Set keySet = map.keySet(predicate); List<Data> list = new ArrayList<Data>(keySet.size()); for (Object o : keySet) { list.add(serializationService.toData(o)); } return list; }
@Override public K getKey() { if (keyObject == null) { keyObject = serializationService.toObject(keyData); } return keyObject; }
OutboundResponseHandler(Address thisAddress, InternalSerializationService serializationService, Node node, ILogger logger) { this.thisAddress = thisAddress; this.serializationService = serializationService; this.useBigEndian = serializationService.getByteOrder() == BIG_ENDIAN; this.node = node; this.logger = logger; }
@Override Object getValue(Object target, String fieldPath) throws Exception { Data data = (Data) target; PortableContext context = serializationService.getPortableContext(); PortableReader reader = serializationService.createPortableReader(data); ClassDefinition classDefinition = context.lookupClassDefinition(data); FieldDefinition fieldDefinition = context.getFieldDefinition(classDefinition, fieldPath); if (fieldDefinition != null) { return ((DefaultPortableReader) reader).read(fieldPath); } else { return null; } }
@Override public ClassLoader getClassLoader() { return serializationService.getClassLoader(); }
@Override public ManagedContext getManagedContext() { return serializationService.getManagedContext(); }
public void doShutdown() { proxyManager.destroy(); connectionManager.shutdown(); clusterService.shutdown(); partitionService.stop(); transactionManager.shutdown(); invocationService.shutdown(); executionService.shutdown(); listenerService.shutdown(); nearCacheManager.destroyAllNearCaches(); if (discoveryService != null) { discoveryService.destroy(); } metricsRegistry.shutdown(); diagnostics.shutdown(); serializationService.dispose(); }
@Override @SuppressWarnings("unchecked") Object getValue(Object target) throws Exception { Object extractionTarget = target; // This part will be improved in 3.7 to avoid extra allocation DefaultValueCollector collector = new DefaultValueCollector(); if (target instanceof Data) { extractionTarget = serializationService.createPortableReader((Data) target); } extractor.extract(extractionTarget, arguments, collector); return collector.getResult(); }
@Override public V getValue() { if (valueObject == null) { valueObject = serializationService.toObject(valueData); } return valueObject; }
@Override protected Object innerCall() throws Exception { final TransactionContext context = endpoint.getTransactionContext(parameters.txnId); final TransactionalMap map = context.getMap(parameters.name); Predicate predicate = serializationService.toObject(parameters.predicate); Collection values = map.values(predicate); List<Data> list = new ArrayList<Data>(values.size()); for (Object o : values) { list.add(serializationService.toData(o)); } return list; }
private V resolve(Object object) { // if there is an explicit value set, we use that if (result != null) { return (V) result; } // if there already is a deserialized value set, use it. if (deserializedValue != VOID) { return (V) deserializedValue; } if (object instanceof Data) { // we need to deserialize. Data data = (Data) object; object = serializationService.toObject(data); //todo do we need to call dispose data here serializationService.disposeData(data); // now we need to try to set the value for other users. for (; ; ) { Object current = deserializedValue; if (current != VOID) { object = current; break; } else if (DESERIALIZED_VALUE.compareAndSet(this, VOID, object)) { break; } } } return (V) object; }
OutboundResponseHandler(Address thisAddress, InternalSerializationService serializationService, Node node, ILogger logger) { this.thisAddress = thisAddress; this.serializationService = serializationService; this.useBigEndian = serializationService.getByteOrder() == BIG_ENDIAN; this.node = node; this.logger = logger; }
@Override Object getValue(Object target, String fieldPath) throws Exception { Data data = (Data) target; PortableContext context = serializationService.getPortableContext(); PortableReader reader = serializationService.createPortableReader(data); ClassDefinition classDefinition = context.lookupClassDefinition(data); FieldDefinition fieldDefinition = context.getFieldDefinition(classDefinition, fieldPath); if (fieldDefinition != null) { return ((DefaultPortableReader) reader).read(fieldPath); } else { return null; } }
@Override public final ClassLoader getClassLoader() { return service.getClassLoader(); }
@Override public ManagedContext getManagedContext() { return serializationService.getManagedContext(); }
public void doShutdown() { proxyManager.destroy(); connectionManager.shutdown(); clusterService.shutdown(); partitionService.stop(); transactionManager.shutdown(); invocationService.shutdown(); executionService.shutdown(); listenerService.shutdown(); nearCacheManager.destroyAllNearCaches(); if (discoveryService != null) { discoveryService.destroy(); } metricsRegistry.shutdown(); diagnostics.shutdown(); ((InternalSerializationService) serializationService).dispose(); }