/** * Causes this channel to delay processing any actions * until the specified UNIX time is reached. * * @return True if blocking was successful, and false otherwise. */ @Deprecated public boolean delayUntil(long msTime) { assert(enterBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; try { if (goHasRoom()) { MsgCommandChannel.publishBlockChannelUntil(msTime, this); return true; } else { return false; } } finally { assert(exitBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; } }
/** * Causes this channel to delay processing any actions until the specified * amount of time has elapsed. * * @param durationNanos Nanos to delay * * @return True if blocking was successful, and false otherwise. */ @Deprecated public boolean delay(long durationNanos) { assert(enterBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; try { if (goHasRoom()) { MsgCommandChannel.publishBlockChannel(durationNanos, this); return true; } else { return false; } } finally { assert(exitBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; } }
/** * * @param msTime time to delay in miliseconds * @return true if msgCommandChannel.goHasRoom <p> else return false */ public boolean delayUntil(long msTime) { assert(msgCommandChannel.enterBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; try { if (msgCommandChannel.goHasRoom()) { MsgCommandChannel.publishBlockChannelUntil(msTime, msgCommandChannel); return true; } else { return false; } } finally { assert(msgCommandChannel.exitBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; } }
/** * * @param durationNanos delay in nanoseconds * @return true if msgCommandChannel.goHasRoom <p> else return false */ public boolean delay(long durationNanos) { assert(msgCommandChannel.enterBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; try { if (msgCommandChannel.goHasRoom()) { MsgCommandChannel.publishBlockChannel(durationNanos, msgCommandChannel); return true; } else { return false; } } finally { assert(msgCommandChannel.exitBlockOk()) : "Concurrent usage error, ensure this never called concurrently"; } }
/** * Takes previous state and changes it to specified state * @param state used to convert original * @param <E> enum for states * @return boolean did xmit change */ public <E extends Enum<E>> boolean changeStateTo(E state) { assert((0 != (msgCommandChannel.initFeatures & MsgCommandChannel.DYNAMIC_MESSAGING))) : "CommandChannel must be created with DYNAMIC_MESSAGING flag"; assert(msgCommandChannel.builder.isValidState(state)); if (!msgCommandChannel.builder.isValidState(state)) { throw new UnsupportedOperationException("no match "+state.getClass()); } if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_CHANGESTATE_70)) { PipeWriter.writeInt(msgCommandChannel.messagePubSub, MessagePubSub.MSG_CHANGESTATE_70_FIELD_ORDINAL_7, state.ordinal()); PipeWriter.publishWrites(msgCommandChannel.messagePubSub); msgCommandChannel.builder.releasePubSubTraffic(1, msgCommandChannel); return true; } return false; }
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_SUBSCRIBE_100)) {
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_UNSUBSCRIBE_101)) {
assert((0 != (msgCommandChannel.initFeatures & MsgCommandChannel.DYNAMIC_MESSAGING))) : "CommandChannel must be created with DYNAMIC_MESSAGING flag"; if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_SUBSCRIBE_100)) {
/** * A method used to unsubscribe from a specific topic and listener * @param topic CharSequence arg used in output.append * @param listener PubSubMethodListenerBase arg used in PipeWriter.writeInt * @return true if msgCommandChannel.goPipe == null || PipeWriter.hasRoomForWrite(msgCommandChannel.goPipe) <p> else false */ public boolean unsubscribe(CharSequence topic, PubSubMethodListenerBase listener) { assert((0 != (msgCommandChannel.initFeatures & MsgCommandChannel.DYNAMIC_MESSAGING))) : "CommandChannel must be created with DYNAMIC_MESSAGING flag"; if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_UNSUBSCRIBE_101)) { PipeWriter.writeInt(msgCommandChannel.messagePubSub, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_SUBSCRIBERIDENTITYHASH_4, System.identityHashCode(listener)); //OLD PipeWriter.writeUTF8(messagePubSub, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1, topic); DataOutputBlobWriter<MessagePubSub> output = PipeWriter.outputStream(msgCommandChannel.messagePubSub); output.openField(); output.append(topic); MsgCommandChannel.publicTrackedTopicSuffix(msgCommandChannel, output); output.closeHighLevelField(MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1); PipeWriter.publishWrites(msgCommandChannel.messagePubSub); msgCommandChannel.builder.releasePubSubTraffic(1, msgCommandChannel); return true; } return false; }
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
/** * * @param session ClientHostPortInstance used as an arg for PipeWriter * @return true or false */ public boolean httpClose(ClientHostPortInstance session) { assert(msgCommandChannel.builder.getHTTPClientConfig() != null); assert((msgCommandChannel.initFeatures & MsgCommandChannel.NET_REQUESTER)!=0) : "must turn on NET_REQUESTER to use this method"; if (msgCommandChannel.goHasRoom() && Pipe.hasRoomForWrite(msgCommandChannel.httpRequest) ) { int size = Pipe.addMsgIdx(msgCommandChannel.httpRequest, ClientHTTPRequestSchema.MSG_CLOSECONNECTION_104); Pipe.addIntValue(session.sessionId, msgCommandChannel.httpRequest); Pipe.addIntValue(session.port, msgCommandChannel.httpRequest); Pipe.addIntValue(session.hostId, msgCommandChannel.httpRequest); Pipe.addLongValue(session.getConnectionId(), msgCommandChannel.httpRequest); Pipe.confirmLowLevelWrite(msgCommandChannel.httpRequest, size); Pipe.publishWrites(msgCommandChannel.httpRequest); MsgCommandChannel.publishGo(1, msgCommandChannel.builder.netIndex(), msgCommandChannel); return true; } return false; }
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
return msgCommandChannel.publishOnPrivateTopic(token, writable); } else { if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
return msgCommandChannel.publishOnPrivateTopic(token, writable); } else { if (msgCommandChannel.goHasRoom() && PipeWriter.tryWriteFragment(msgCommandChannel.messagePubSub, MessagePubSub.MSG_PUBLISH_103)) {
return msgCommandChannel.publishFailableOnPrivateTopic(token, writable); } else { if (msgCommandChannel.goHasRoom() && PipeWriter.hasRoomForWrite(msgCommandChannel.messagePubSub)) { PubSubWriter pw = (PubSubWriter) Pipe.outputStream(msgCommandChannel.messagePubSub);
if (msgCommandChannel.goHasRoom() ) {