• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EthernetAddress类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.fasterxml.uuid.EthernetAddress的典型用法代码示例。如果您正苦于以下问题:Java EthernetAddress类的具体用法?Java EthernetAddress怎么用?Java EthernetAddress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EthernetAddress类属于com.fasterxml.uuid包,在下文中一共展示了EthernetAddress类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ensureGeneratorInitialized

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
private static void ensureGeneratorInitialized() {
    if (timeGenerator == null) {
        synchronized (UUIDUtils.class) {
            if (timeGenerator == null) {
                timeGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
            }
        }
    }
    if (randomGenerator == null) {
        synchronized (com.fasterxml.uuid.UUIDGenerator.class) {
            if (randomGenerator == null) {
                randomGenerator = Generators.randomBasedGenerator();
            }
        }
    }
}
 
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:17,代码来源:UUIDUtils.java


示例2: preStart

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
/**
 * Establishes a connection with the webtrends stream api
 * @see akka.actor.UntypedActor#preStart()
 */
public void preStart() throws Exception {
			
	// initialize the uuid generator which is based on time and ethernet address
	this.uuidGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
	
	// authenticate with the webtrends service
	WebtrendsTokenRequest tokenRequest = new WebtrendsTokenRequest(this.authUrl, this.authAudience, this.authScope, this.clientId, this.clientSecret);
	this.oAuthToken = tokenRequest.execute();		
	
	// initialize the webtrends stream socket client and connect the listener
	this.webtrendsStreamSocketClient = new WebSocketClient();
	try {
		this.webtrendsStreamSocketClient.start();
		ClientUpgradeRequest upgradeRequest = new ClientUpgradeRequest();
		this.webtrendsStreamSocketClient.connect(this, new URI(this.eventStreamUrl), upgradeRequest);
		await(5, TimeUnit.SECONDS);
	} catch(Exception e) {
		throw new RuntimeException("Unable to connect to web socket: " + e.getMessage(), e);
	}
	
	this.componentRegistryRef.tell(new ComponentRegistrationMessage(EVENT_SOURCE_ID, ComponentType.STREAM_LISTENER, getSelf()), getSelf());
}
 
开发者ID:mnxfst,项目名称:stream-analyzer,代码行数:27,代码来源:WebtrendsStreamListenerActor.java


示例3: ensureGeneratorInitialized

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
protected void ensureGeneratorInitialized() {
    if (timeBasedGenerator == null) {
        synchronized (UuidIdGenerator.class) {
            if (timeBasedGenerator == null) {
                timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
            }
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:UuidIdGenerator.java


示例4: ensureGeneratorInitialized

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
protected void ensureGeneratorInitialized() {
    if (timeBasedGenerator == null) {
        synchronized (StrongUuidGenerator.class) {
            if (timeBasedGenerator == null) {
                timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
            }
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:StrongUuidGenerator.java


示例5: ensureGeneratorInitialized

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
protected void ensureGeneratorInitialized() {
  if (timeBasedGenerator == null) {
    synchronized (StrongUuidGenerator.class) {
      if (timeBasedGenerator == null) {
        timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
      }
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:StrongUuidGenerator.java


示例6: getUuidGenerator

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
@Override
   public TimeBasedGenerator getUuidGenerator() {
	if (uuidGenerator == null) {
		EthernetAddress nic = EthernetAddress.fromInterface();
		if (nic == null) {
			// construct address with a random number
			nic = EthernetAddress.constructMulticastAddress();
		}
		uuidGenerator = Generators.timeBasedGenerator(nic);
	}
	return uuidGenerator;
}
 
开发者ID:Tesora,项目名称:tesora-dve-pub,代码行数:13,代码来源:Host.java


示例7: UUIDTimeIDGenerator

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
public UUIDTimeIDGenerator() {
    try {
        uuid1 = new File(System.getProperty("java.io.tmpdir") + File.separator + "uuid1.lck");
        uuid2 = new File(System.getProperty("java.io.tmpdir") + File.separator + "uuid2.lck");

        synchronizer = new FileBasedTimestampSynchronizer(uuid1, uuid2);

        generator = Generators.timeBasedGenerator(EthernetAddress.fromInterface(), synchronizer);
    } catch (IOException e) {
        log.error("error initialising time-based UUID generator",e);
    }
}
 
开发者ID:apache,项目名称:marmotta,代码行数:13,代码来源:UUIDTimeIDGenerator.java


示例8: generateV1Uuid

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
public static String generateV1Uuid(){
	EthernetAddress addr = EthernetAddress.fromInterface();
	TimeBasedGenerator uuidGenerator = Generators.timeBasedGenerator(addr);
	UUID uuid = uuidGenerator.generate();
	return uuid.toString();
}
 
开发者ID:hotpads,项目名称:datarouter,代码行数:7,代码来源:UuidTool.java


示例9: generateTimeBasedUUID

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
public static UUID generateTimeBasedUUID()
{
    return Generators.timeBasedGenerator( EthernetAddress.fromInterface() ).generate();
}
 
开发者ID:subutai-io,项目名称:base,代码行数:5,代码来源:UUIDUtil.java


示例10: newTimeUUID

import com.fasterxml.uuid.EthernetAddress; //导入依赖的package包/类
/**
 * Generate a timeuuid with the given timestamp in milliseconds and the time offset. Useful when you need to
 * generate sequential UUIDs for the same period in time. I.E
 * <p/>
 * newTimeUUID(1000, 0) <br/> newTimeUUID(1000, 1) <br /> newTimeUUID(1000, 2) <br />
 * <p/>
 * etc.
 * <p/>
 * Only use this method if you are absolutely sure you need it. When it doubt use the method without the timestamp
 * offset
 *
 * @param ts The timestamp in milliseconds
 * @param timeoffset The offset, which should always be <= 10000. If you go beyond this range, the millisecond will
 * be incremented since this is beyond the possible values when coverrting from millis to 1/10 microseconds stored
 * in the time uuid.
 */
public static UUID newTimeUUID( long ts, int timeoffset ) {
    if ( ts == 0 ) {
        return newTimeUUID();
    }

    byte[] uuidBytes = new byte[16];
    // 47 bits of randomness
    EthernetAddress eth = EthernetAddress.constructMulticastAddress();
    eth.toByteArray( uuidBytes, 10 );
    setTimestamp( ts, uuidBytes, getRandomClockSequence(), timeoffset );

    return uuid( uuidBytes );
}
 
开发者ID:apache,项目名称:usergrid,代码行数:30,代码来源:UUIDUtils.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DependencyResolutionException类代码示例发布时间:2022-05-21
下一篇:
Java DexBackedMethod类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap