package com.ym.mec.thirdparty.threadLocal;


public class BucketContextHolder {


	private static final ThreadLocal<BucketEnum> bucketContextHolder = new ThreadLocal<>();

	public static void setBucket(BucketEnum bucket) {
		bucketContextHolder.set(bucket);
	}

	public static BucketEnum getBucket() {
		BucketEnum bucket = bucketContextHolder.get();
		if (bucket == null){
			return BucketEnum.daya;
		}
		return bucketContextHolder.get();
	}

	public static void clearBucket() {
		bucketContextHolder.remove();
	}

}
