use of com.ociweb.pronghorn.util.TrieParserReader in project GreenLightning by oci-pronghorn.
the class MsgCommandChannel method unScopedCheckForTrack.
private static void unScopedCheckForTrack(MsgCommandChannel cmd, DataOutputBlobWriter<MessagePubSub> output) {
boolean addSuffix = false;
if (null != cmd.unScopedReader) {
// only do this if 1. we are tracked & 2. there are unscoped topics
addSuffix = BuilderImpl.notUnscoped(cmd.unScopedReader, output);
} else {
cmd.unScopedReader = new TrieParserReader(0, true);
// only do this if 1. we are tracked & 2. there are unscoped topics
addSuffix = BuilderImpl.notUnscoped(cmd.unScopedReader, output);
}
if (addSuffix) {
output.write(cmd.track);
}
}
use of com.ociweb.pronghorn.util.TrieParserReader in project GreenLightning by oci-pronghorn.
the class ReactiveListenerStage method addSubscription.
public final <T extends Behavior> ListenerFilter addSubscription(CharSequence topic, CallableStaticMethod<T> method) {
if (null == methods) {
methodLookup = new TrieParser(16, 1, false, false, false);
methodReader = new TrieParserReader(0, true);
methods = new CallableStaticMethod[0];
}
if (!startupCompleted && listener instanceof PubSubMethodListenerBase) {
builder.addStartupSubscription(topic, System.identityHashCode(listener), parallelInstance);
toStringDetails = toStringDetails + "sub:'" + topic + "'\n";
} else {
if (startupCompleted) {
throw new UnsupportedOperationException("Method dispatch subscritpions may not be modified at runtime.");
}
}
int id = methods.length;
methodLookup.setUTF8Value(topic, id);
// grow the array of methods to be called
CallableStaticMethod[] newArray = new CallableStaticMethod[id + 1];
System.arraycopy(methods, 0, newArray, 0, id);
newArray[id] = method;
methods = newArray;
//
return this;
}
Aggregations