Tabnine Logo
DistributableEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
DistributableEntry
in
com.oracle.coherence.patterns.eventdistribution.events

Best Java code snippets using com.oracle.coherence.patterns.eventdistribution.events.DistributableEntry (Showing top 18 results out of 315)

origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

  @Override
  public String toString()
  {
    Object key           = null;
    Object value         = null;
    Object originalValue = null;

    if (context != null)
    {
      try
      {
        key           = getKey();
        value         = getValue();
        originalValue = getOriginalValue();
      }
      catch (RuntimeException e)
      {
        // no op we just can deserialize the key or the value we'll use the binary version
      }
    }

    return String.format("DistributableEntry{key=%s, value=%s, originalValue=%s}",
               (key == null ? getBinaryKey() : key),
               (value == null ? getBinaryValue() : value),
               (originalValue == null ? getOriginalBinaryValue() : originalValue));
  }
}
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

/**
 * Extracts the {@link ClusterMetaInfo} of the {@link Cluster} from where the {@link EntryEvent} originated.
 *
 * @param entryEvent The {@link DistributableEntryEvent} from which to determine the {@link ClusterMetaInfo}.
 *
 * @return {@link ClusterMetaInfo}
 */
@SuppressWarnings({"rawtypes"})
private ClusterMetaInfo getSourceClusterMetaInfo(DistributableEntryEvent entryEvent)
{
  Binary binaryValue = entryEvent.getEntry().getBinaryValue();
  Map decorations = binaryValue == null
           ? null : (Map) entryEvent.getEntry().getContext().getInternalValueDecoration(binaryValue,
                                                  BackingMapManagerContext
                                                    .DECO_CUSTOM);
  if (decorations == null)
  {
    throw new IllegalStateException("Can't extract the CLUSTER_INFO_DECORATION_KEY from the EntryEvent. The BinaryValue is not decorated");
  }
  ClusterMetaInfo sourceClusterMetaInfo =
    (ClusterMetaInfo) decorations.get(DistributableEntry.CLUSTER_META_INFO_DECORATION_KEY);
  if (sourceClusterMetaInfo == null)
  {
    throw new IllegalStateException("Expecting a non-null value for CLUSTER_INFO_DECORATION_KEY");
  }
  return sourceClusterMetaInfo;
}
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

@Override
public Object getKey()
{
  Object key;
  if (binaryKey == null || binaryKey.length() == 0)
  {
    key = null;
  }
  else
  {
    try
    {
      if (getContext() == null && getSerializer() != null)
      {
        key = serializer.deserialize(binaryKey.getBufferInput());
      }
      else
      {
        key = getContext().getKeyFromInternalConverter().convert(binaryKey);
      }
    }
    catch (Exception e)
    {
      throw Base.ensureRuntimeException(e);
    }
  }
  // TODO: we should hold a weak reference to the result as we might call this method again.
  return key;
}
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

  /**
   * {@inheritDoc}
   */
  @Override
  public boolean evaluate(Object object)
  {
    if (object instanceof DistributableEntryEvent)
    {
      DistributableEntryEvent e     = (DistributableEntryEvent) object;
      SimpleMapEntry entry = new SimpleMapEntry(e.getEntry().getKey(), e.getEntry().getOriginalValue());

      return m_filter.evaluateEntry(entry);
    }
    else
    {
      return false;
    }
  }
}
origin: com.oracle.coherence.incubator/coherence-pushreplicationpattern

new DistributableEntry(entry.getBinaryKey(),
            decoratedBinaryValue,
            originalBinaryValue,
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

entryEvent.getEntry().setContext(targetEntry.getContext());
  targetEntry.updateBinaryValue((Binary) entryEvent.getEntry().getBinaryValue());
  long expiry = entryEvent.getEntry().getExpiry();
  Binary binaryValue = entryEvent.getEntry().getBinaryValue();
  Map srcDecorations = binaryValue == null
             ? new HashMap()
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

public long getExpiry()
{
  // obtain the date/time the entry will expire
  long expiryTime = ExternalizableHelper.decodeExpiry(getBinaryValue());
  if (expiryTime == CacheMap.EXPIRY_DEFAULT || expiryTime == CacheMap.EXPIRY_NEVER)
  {
    return expiryTime;
  }
  else
  {
    long deltaTime = expiryTime - Base.getSafeTimeMillis();
    return deltaTime <= 0 ? -2 : deltaTime;
  }
}
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

entryEvent.getEntry().setContext(context);
Binary      binKey   = entryEvent.getEntry().getBinaryKey();
BinaryEntry binEntry = entryEvent.getEntry();
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

namedCache.invoke(entryEvent.getEntry().getBinaryKey(),
    new EntryEventProcessor(entryEvent,
        conflictResolverBuilder,
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

@Override
public Object setValue(Object value)
{
  // we need to return the previous value
  Object oPrevious = getValue();
  // remember the existing custom decorations as we'll need to re-decorate them after we change the value
  Object oDecorations = binaryValue == null ? null : context.getInternalValueDecoration(binaryValue,
                                             BackingMapManagerContext
                                               .DECO_CUSTOM);
  if (context == null)
  {
    throw new UnsupportedOperationException("DistributableEntry doesn't have a BackingMapContext so unable to serialize the new value.");
  }
  else
  {
    // serialize/convert the new value to a binary
    binaryValue = (Binary) context.getValueToInternalConverter().convert(value);
    // re-add the custom decorations (if we have any)
    binaryValue = oDecorations == null
           ? binaryValue
           : (Binary) context.addInternalValueDecoration(binaryValue,
                                  BackingMapManagerContext.DECO_CUSTOM,
                                  oDecorations);
    return oPrevious;
  }
}
origin: com.oracle.coherence.incubator/coherence-pushreplicationpattern

 new DistributableEntry(binaryKey,
            decoratedBinaryValue,
            new Binary(),
new DistributableEntry(binaryKey,
            decoratedBinaryValue,
            originalBinaryValue,
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

Binary             binKey = entry.getBinaryKey();
int iPartition = getCacheService().getBackingMapManager().getContext().getKeyPartition(binKey);
origin: com.oracle.coherence.incubator/coherence-pushreplicationpattern

Binary                  binaryValue = entryEvent.getEntry().getBinaryValue();
         ? null : (Map) entryEvent.getEntry().getContext().getInternalValueDecoration(binaryValue,
                                                BackingMapManagerContext
                                                  .DECO_CUSTOM);
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

@Override
public Object getValue()
{
  Object value;
  if (binaryValue == null || binaryValue.length() == 0)
  {
    value = null;
  }
  else
  {
    try
    {
      if (getContext() == null && getSerializer() != null)
      {
        value = serializer.deserialize(binaryValue.getBufferInput());
      }
      else
      {
        value = getContext().getValueFromInternalConverter().convert(binaryValue);
      }
    }
    catch (Exception e)
    {
      throw Base.ensureRuntimeException(e);
    }
  }
  // TODO: we should hold a weak reference to the result as we might call this method again.
  return value;
}
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

DistributableEntry distributableEntry = new DistributableEntry(binaryKey,
                                binaryValue,
                                null,
origin: com.oracle.coherence.incubator/coherence-eventdistributionpattern

@Override
public Object getOriginalValue()
{
  Object originalValue;
  if (originalBinaryValue == null || originalBinaryValue.length() == 0)
  {
    originalValue = null;
  }
  else
  {
    try
    {
      if (getContext() == null && getSerializer() != null)
      {
        originalValue = serializer.deserialize(originalBinaryValue.getBufferInput());
      }
      else
      {
        originalValue = getContext().getValueFromInternalConverter().convert(originalBinaryValue);
      }
    }
    catch (Exception e)
    {
      throw Base.ensureRuntimeException(e);
    }
  }
  // TODO: we should hold a weak reference to the result as we might call this method again.
  return originalValue;
}
origin: com.oracle.coherence.incubator/coherence-pushreplicationpattern

 new DistributableEntry(binaryKey,
            decoratedBinaryValue,
            null,
new DistributableEntry(binaryKey,
            decoratedBinaryValue,
            originalBinaryValue,
origin: com.oracle.coherence.incubator/coherence-pushreplicationpattern

new DistributableEntry(entry.getBinaryKey(),
            decoratedBinaryValue,
            originalBinaryValue,
com.oracle.coherence.patterns.eventdistribution.eventsDistributableEntry

Javadoc

A DistributableEntry is an specialized BinaryEntry design to be distributed as part of a DistributableEntryEvent.

Copyright (c) 2011. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Most used methods

  • <init>
    Standard Constructor (with a BinaryEntry).
  • getBinaryValue
  • getContext
  • getBinaryKey
  • getExpiry
  • getKey
  • getOriginalBinaryValue
  • getOriginalValue
  • getSerializer
  • getValue
  • setContext
    Sets the BackingMapManagerContext for the Entry.
  • setOriginalBinaryValue
  • setContext,
  • setOriginalBinaryValue,
  • setValue

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JTable (javax.swing)
  • Github Copilot alternatives
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