当前位置: 首页>>代码示例>>Java>>正文


Java PipeReader.readInt方法代码示例

本文整理汇总了Java中com.ociweb.pronghorn.pipe.PipeReader.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java PipeReader.readInt方法的具体用法?Java PipeReader.readInt怎么用?Java PipeReader.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ociweb.pronghorn.pipe.PipeReader的用法示例。


在下文中一共展示了PipeReader.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
@Override
public void run() {
    
    if (moveInProgress) {
        if (!PipeReader.tryMoveSingleMessage(input, output)) {
            return;
        } else {
            moveInProgress = false;
            PipeReader.releaseReadLock(input);
        }
    }
    
    while (PipeWriter.hasRoomForWrite(output) && PipeReader.tryReadFragment(input)) {
                    
        count++;
        int value = PipeReader.readInt(input, varFieldLoc);  
        
        if (0 != (mask&value)) {
            if (!PipeReader.tryMoveSingleMessage(input, output)) {
                moveInProgress = true;
                return;
            }              
        }
        PipeReader.releaseReadLock(input);
    }        
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:27,代码来源:FlagFilterStage.java

示例2: readAndWrite

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
void readAndWrite(Pipe<ValveSchema> input, Pipe<ValveSchema> output) {
	currentStationId = PipeReader.readInt(input, stationFieldId);
	currentTimeStamp = PipeReader.readLong(input, timestampFieldId);
	if (readValue(input)) {
		publish(output);
	}
	//else {
	//	System.out.format("Filtered %d, %d, %d\n", msgIdx, currentStationId, currentTimeStamp);
	//}
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:11,代码来源:FilterStage.java

示例3: readValue

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
@Override
protected boolean readValue(Pipe<ValveSchema> input) {
	int newValue = PipeReader.readInt(input,valueId);
	if (newValue != currentValue) {
		currentValue = newValue;
		return true;
	}
	return false;
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:10,代码来源:FilterStage.java

示例4: consumePublish

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
private void consumePublish(Pipe<MQTTServerToClientSchema> input) {
	long fieldTime = PipeReader.readLong(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_TIME_37);
	int fieldPacketId = PipeReader.readInt(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_PACKETID_20);
	int fieldQOS = PipeReader.readInt(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_QOS_21);
	int fieldRetain = PipeReader.readInt(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_RETAIN_22);
	int fieldDup = PipeReader.readInt(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_DUP_36);
	StringBuilder fieldTopic = PipeReader.readUTF8(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_TOPIC_23,new StringBuilder(PipeReader.readBytesLength(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_TOPIC_23)));
	ByteBuffer fieldPayload = PipeReader.readBytes(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_PAYLOAD_25,ByteBuffer.allocate(PipeReader.readBytesLength(input,MQTTServerToClientSchema.MSG_PUBLISH_3_FIELD_PAYLOAD_25)));
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:MQTTServerToClientEncodeStage.java

示例5: consumeHTTPPost

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeHTTPPost(Pipe<ClientHTTPRequestSchema> input) {
    int fieldDestination = PipeReader.readInt(input,MSG_HTTPPOST_101_FIELD_DESTINATION_11);
    int fieldSession = PipeReader.readInt(input,MSG_HTTPPOST_101_FIELD_SESSION_10);
    int fieldPort = PipeReader.readInt(input,MSG_HTTPPOST_101_FIELD_PORT_1);
    StringBuilder fieldHost = PipeReader.readUTF8(input,MSG_HTTPPOST_101_FIELD_HOST_2,new StringBuilder(PipeReader.readBytesLength(input,MSG_HTTPPOST_101_FIELD_HOST_2)));
    StringBuilder fieldPath = PipeReader.readUTF8(input,MSG_HTTPPOST_101_FIELD_PATH_3,new StringBuilder(PipeReader.readBytesLength(input,MSG_HTTPPOST_101_FIELD_PATH_3)));
    StringBuilder fieldHeaders = PipeReader.readUTF8(input,MSG_HTTPPOST_101_FIELD_HEADERS_7,new StringBuilder(PipeReader.readBytesLength(input,MSG_HTTPPOST_101_FIELD_HEADERS_7)));
    DataInputBlobReader<ClientHTTPRequestSchema> fieldPayload = PipeReader.inputStream(input, MSG_HTTPPOST_101_FIELD_PAYLOAD_5);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:ClientHTTPRequestSchema.java

示例6: consumeFastHTTPPost

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeFastHTTPPost(Pipe<ClientHTTPRequestSchema> input) {
    int fieldDestination = PipeReader.readInt(input,MSG_FASTHTTPPOST_201_FIELD_DESTINATION_11);
    int fieldSession = PipeReader.readInt(input,MSG_FASTHTTPPOST_201_FIELD_SESSION_10);
    int fieldPort = PipeReader.readInt(input,MSG_FASTHTTPPOST_201_FIELD_PORT_1);
    StringBuilder fieldHost = PipeReader.readUTF8(input,MSG_FASTHTTPPOST_201_FIELD_HOST_2,new StringBuilder(PipeReader.readBytesLength(input,MSG_FASTHTTPPOST_201_FIELD_HOST_2)));
    long fieldConnectionId = PipeReader.readLong(input,MSG_FASTHTTPPOST_201_FIELD_CONNECTIONID_20);
    StringBuilder fieldPath = PipeReader.readUTF8(input,MSG_FASTHTTPPOST_201_FIELD_PATH_3,new StringBuilder(PipeReader.readBytesLength(input,MSG_FASTHTTPPOST_201_FIELD_PATH_3)));
    StringBuilder fieldHeaders = PipeReader.readUTF8(input,MSG_FASTHTTPPOST_201_FIELD_HEADERS_7,new StringBuilder(PipeReader.readBytesLength(input,MSG_FASTHTTPPOST_201_FIELD_HEADERS_7)));
    DataInputBlobReader<ClientHTTPRequestSchema> fieldPayload = PipeReader.inputStream(input, MSG_FASTHTTPPOST_201_FIELD_PAYLOAD_5);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:11,代码来源:ClientHTTPRequestSchema.java

示例7: consumeSubscribe

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeSubscribe(Pipe<MessagePubSub> input) {
    StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_SUBSCRIBE_100_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_SUBSCRIBE_100_FIELD_TOPIC_1)));
    int fieldSubscriberIdentityHash = PipeReader.readInt(input,MSG_SUBSCRIBE_100_FIELD_SUBSCRIBERIDENTITYHASH_4);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:5,代码来源:MessagePubSub.java

示例8: consumeUnsubscribe

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeUnsubscribe(Pipe<MessagePubSub> input) {
    StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1)));
    int fieldSubscriberIdentityHash = PipeReader.readInt(input,MSG_UNSUBSCRIBE_101_FIELD_SUBSCRIBERIDENTITYHASH_4);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:5,代码来源:MessagePubSub.java

示例9: consumePublish

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumePublish(Pipe<MessagePubSub> input) {
    int fieldQOS = PipeReader.readInt(input,MSG_PUBLISH_103_FIELD_QOS_5);
    StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_PUBLISH_103_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_PUBLISH_103_FIELD_TOPIC_1)));
    DataInputBlobReader<MessagePubSub> fieldPayload = PipeReader.inputStream(input, MSG_PUBLISH_103_FIELD_PAYLOAD_3);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:6,代码来源:MessagePubSub.java

示例10: consumeChangeState

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeChangeState(Pipe<MessagePubSub> input) {
    int fieldOrdinal = PipeReader.readInt(input,MSG_CHANGESTATE_70_FIELD_ORDINAL_7);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:4,代码来源:MessagePubSub.java

示例11: consumeGo

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeGo(Pipe<TrafficOrderSchema> input) {
    int fieldPipeIdx = PipeReader.readInt(input,MSG_GO_10_FIELD_PIPEIDX_11);
    int fieldCount = PipeReader.readInt(input,MSG_GO_10_FIELD_COUNT_12);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:5,代码来源:TrafficOrderSchema.java

示例12: consumeStateChanged

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeStateChanged(Pipe<MessageSubscription> input) {
    int fieldOldOrdinal = PipeReader.readInt(input,MSG_STATECHANGED_71_FIELD_OLDORDINAL_8);
    int fieldNewOrdinal = PipeReader.readInt(input,MSG_STATECHANGED_71_FIELD_NEWORDINAL_9);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:5,代码来源:MessageSubscription.java

示例13: consumeRelease

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeRelease(Pipe<TrafficReleaseSchema> input) {
    int fieldCount = PipeReader.readInt(input,MSG_RELEASE_20_FIELD_COUNT_22);
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:4,代码来源:TrafficReleaseSchema.java

示例14: processStartupSubscriptions

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
private void processStartupSubscriptions(Pipe<MessagePubSub> pipe) {
  	 
  	if (null==pipe) {
  		logger.info("warning this stage was created but there are no subscriptions to be routed.");
  		return; //no subscriptions were added.
  	}
  	/////////////////////////
  	//WARNING: none of these operations can use outgoing pipes, they are not started yet.
  	//         This code can and does take in the startup pipe and sets up local(internal) state
  	////////////////////////
  	
while (PipeReader.tryReadFragment(pipe)) {
          
          int msgIdx = PipeReader.getMsgIdx(pipe);
         
          switch (msgIdx)  {
          	case MessagePubSub.MSG_CHANGESTATE_70:
          		
          		if (newState!=currentState) {
          			throw new UnsupportedOperationException("On startup there can only be 1 initial state");
          		}
          		
          		newState = PipeReader.readInt(pipe, MessagePubSub.MSG_CHANGESTATE_70_FIELD_ORDINAL_7);
          				
          		//NOTE: this is sent to all outgoing pipes, some may not want state but are only here for listening to particular topics.
          		//      This might be improved in the future if needed by capturing the list of only those pipes connected to instances of StateChangeListeners.
              	for(int i = 0; i<outgoingMessagePipes.length; i++) {
              		pendingPublish[pendingPublishCount++] = i;
              	}
          		break;
              case MessagePubSub.MSG_SUBSCRIBE_100:
                    addSubscription(pipe);                                  
                  break;
              default:                    
              	 throw new UnsupportedOperationException("Can not do "+msgIdx+" on startup");    
              
          }            
          PipeReader.releaseReadLock(pipe);

}
  }
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:42,代码来源:MessagePubSubStage.java

示例15: consumeValveSerialNumber

import com.ociweb.pronghorn.pipe.PipeReader; //导入方法依赖的package包/类
public static void consumeValveSerialNumber(Pipe<ValveSchema> input) {
    int fieldStation = PipeReader.readInt(input,MSG_VALVESERIALNUMBER_311_FIELD_STATION_1);
    long fieldTimestamp = PipeReader.readLong(input,MSG_VALVESERIALNUMBER_311_FIELD_TIMESTAMP_2);
    int fieldValveSerialNumber = PipeReader.readInt(input,MSG_VALVESERIALNUMBER_311_FIELD_VALVESERIALNUMBER_11);
}
 
开发者ID:oci-pronghorn,项目名称:FogLight-Examples,代码行数:6,代码来源:ValveSchema.java


注:本文中的com.ociweb.pronghorn.pipe.PipeReader.readInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。