myeclipse subscriberr entry什么意思

Android(8)
之前看过EventBus的源码,不是很深入,导致有些模糊,此次仔细阅读了一下,记录笔记,方便以后熟悉。
本篇主要说一下register的过程:
private synchronized void register(Object subscriber, boolean sticky, int priority) {
List&SubscriberMethod& subscriberMethods = subscriberMethodFinder.findSubscriberMethods(subscriber.getClass());
for (SubscriberMethod subscriberMethod : subscriberMethods) {
subscribe(subscriber, subscriberMethod, sticky, priority);
findSubscriberMethods这个方法很长,大致要做的事情就是查找出该类以及其父类中声明的所有方法,根据规则(只能public修饰onEvent开头且只有一个参数)筛选出订阅方法,一起看一下吧,具体就在代码中写说明了,删除了部分代码限制篇幅:
List&SubscriberMethod& findSubscriberMethods(Class&?& subscriberClass) {
subscriberMethods = new ArrayList&SubscriberMethod&();
Class&?& clazz = subscriberC
HashSet&String& eventTypesFound = new HashSet&String&();
StringBuilder methodKeyBuilder = new StringBuilder();
while (clazz != null) {
String name = clazz.getName();
if (name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("android.")) {
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
String methodName = method.getName();
if (methodName.startsWith(ON_EVENT_METHOD_NAME)) {
int modifiers = method.getModifiers();
if ((modifiers & Modifier.PUBLIC) != 0 && (modifiers & MODIFIERS_IGNORE) == 0) {
Class&?&[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length == 1) {
String modifierString = methodName.substring(ON_EVENT_METHOD_NAME.length());
ThreadMode threadM
if (modifierString.length() == 0) {
threadMode = ThreadMode.PostT
} else if (modifierString.equals("MainThread")) {
threadMode = ThreadMode.MainT
} else if (modifierString.equals("BackgroundThread")) {
threadMode = ThreadMode.BackgroundT
} else if (modifierString.equals("Async")) {
threadMode = ThreadMode.A
Class&?& eventType = parameterTypes[0];
methodKeyBuilder.setLength(0);
methodKeyBuilder.append(methodName).append('&').append(eventType.getName());
String methodKey = methodKeyBuilder.toString();
if (eventTypesFound.add(methodKey)) {
subscriberMethods.add(new SubscriberMethod(method, threadMode, eventType));
} else if (!skipMethodVerificationForClasses.containsKey(clazz)) {
Log.d(EventBus.TAG, "Skipping method (not public, static or abstract): " + clazz + "."
+ methodName);
clazz = clazz.getSuperclass();
接下来看subscribe(subscriber, subscriberMethod, sticky, priority);这个方法是干啥的,总结来说就是把所有事件类型为eventType的订阅者放入List列表中,并放入Map集合中。然后再根据订阅事件的类构造一个订阅事件列表,用来判断某个类是否已经注册过事件,看一下代码:
private void subscribe(Object subscriber, SubscriberMethod subscriberMethod, boolean sticky, int priority) {
Class&?& eventType = subscriberMethod.eventT
CopyOnWriteArrayList&Subscription& subscriptions = subscriptionsByEventType.get(eventType);
Subscription newSubscription = new Subscription(subscriber, subscriberMethod, priority);
if (subscriptions == null) {
subscriptions = new CopyOnWriteArrayList&Subscription&();
subscriptionsByEventType.put(eventType, subscriptions);
if (subscriptions.contains(newSubscription)) {
throw new EventBusException("Subscriber " + subscriber.getClass() + " already registered to event "
+ eventType);
int size = subscriptions.size();
for (int i = 0; i &= i++) {
if (i == size || newSubscription.priority & subscriptions.get(i).priority) {
subscriptions.add(i, newSubscription);
List&Class&?&& subscribedEvents = typesBySubscriber.get(subscriber);
if (subscribedEvents == null) {
subscribedEvents = new ArrayList&Class&?&&();
typesBySubscriber.put(subscriber, subscribedEvents);
subscribedEvents.add(eventType);
if (sticky) {
if (eventInheritance) {
Set&Map.Entry&Class&?&, Object&& entries = stickyEvents.entrySet();
for (Map.Entry&Class&?&, Object& entry : entries) {
Class&?& candidateEventType = entry.getKey();
if (eventType.isAssignableFrom(candidateEventType)) {
Object stickyEvent = entry.getValue();
checkPostStickyEventToSubscription(newSubscription, stickyEvent);
Object stickyEvent = stickyEvents.get(eventType);
checkPostStickyEventToSubscription(newSubscription, stickyEvent);
post某个事件时需要注意的一点是如果你post的事件类型为A,那么所有订阅过A的超类的事件也同样会被触发,时间原因,源码不分析,后续有时间接着写,记此笔记,方便自己查阅!
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:5283次
排名:千里之外
原创:11篇
(1)(2)(1)(1)(1)(3)(1)(1)(1)人人网 - 抱歉
哦,抱歉,好像看不到了
现在你可以:
看看其它好友写了什么
北京千橡网景科技发展有限公司:
文网文[号··京公网安备号·甲测资字
文化部监督电子邮箱:wlwh@··
文明办网文明上网举报电话: 举报邮箱:&&&&&&&&&&&&< IN THE MEDIA
July 11, 2013 Dayton Daily News Feature story in Life Section (Click thumbnail to read the story)
September 3, 2011 FEATURED IN THE TLC REALITY TV SHOW "HIGH STAKES SWEEPERS" Watch it for the first time or watch it again, here's the FULL SHOW!
August 2011, ABC's GMA (Good Morning America) & their 20/20 evening news show. Both clips are shown below.
6/8/11 DISCOVERY CHANNEL PRESS RELEASE:
4/20/09 RADIO INTERVIEW:
4/23/08 FEATURED IN THE BOOK by
1/15/07 PRESS RELEASE: &
Powersweepstaking Sweepstakes Lists
YOU ARE HEREDAILY ENTRY SWEEPS Enter from this list everyday, day in and day out for your best chance
Great Contests at these sites:
By Administrator, on March 1st, 2016
&&&&&&&&TODAY is TUESDAY MARCH 1ST,&Powersweepstaking presents a dozen different categories(links are down the left margin),&100+ sweepstakes to enter TODAY!&
As a visitor you&#8217;ll have limited access,&ONLY competitions that end within the next week or so.&Oh,&I&#8217;d say about 10% of the sweepstakes made available to subscribers.&Subscribers have ALL 1,000+ sweeps,&sent direct to email,&updated every day &#038; AN ENTIRE DAY EARLIER then you see them posted here on this page.&Posting here ONLY IF,&again IF,&I find the time on any given day(not every day do I find an extra 2 hours for desktop publishing to update this and other pages on the site).&For EVERY DAY GUARANTEED updates, you&#8217;ll need to subscribe to the POWERSWEEPSTAKING DAILY NEWSLETTER!&Now everyone,&MAC,&CHROME,&TABLET and SMARTPHONE users can feel organized with their entry process!&New sweepstakes added daily,&ex&weekly and monthly competitions organized so they&#8217;re not seen again by you until next week,&or next month.&We do all of the organization so you don&#8217;t have to!&For you there&#8217;s no more work searching for sweeps,&reading rules,&finding entry forms or going off your focus on entering.
&&&&NEWSLETTER SUBSCRIBER PERK: YOUR referral link distributed to the hundreds of visitors and subscribers daily.&Your FAVORITE or MOST IMPORTANT referral sweeps featured on our site.&YOUR REFERRAL LINK to win a car,&an appliance,&a trip or cash will be shared,&tweeted,&published to the site and then entered by other Powersweepstaking subscribers and site visitors.&FYI&real world advertising rates to tweet are $1 per tweet,&per 1,000&a tweet or Facebook share for your link once every few days to my 4,400+ twitter followers is worth $4 per tweet,&over one month that&#8217;s a $100+ value,&INCLUDED as a subscriber!&Many subscribe JUST FOR THIS PERK.&Have as many as 5 live referral links at any given time!&MORE ENTRIES&=&MORE WINS!
K Cool Rewards $2500 cash prize!
Entenmanns GRAND PRIZE (1): $5,000 awarded in the form of a check. Approximate Retail Value (&EURoeARV&EUR?) of Grand Prize: $5,000. FIRST PRIZES (10): A $1,000 American Express gift card. ARV of each First Prize: $1,000. SECOND PRIZES (25): A Rich Frosted Plush Toy. ARV of each Second Prize: $8.
19Crimes, win the TRIP OF A LIFETIME TO AUSTRALIA
The Walking Dead Xtream Sweeps, You and your favorite walker can win a trip and tickets to the live filming of Talking Dead in Los Angeles, California on April 3rd!
iHeartRadio A trip for (2) two to the Swan Mendes World Tour stop in San Diego, California (July 23, 2016)
Mohawak Floors, ALL PET protection Sweepstakes, win a $1000 rug
*DigiNext Films win a trip for two to Nashville, TN
&#8211; 10x REFERRALS MAX OVER PROMO. PRIZES: Twenty-five (25) Prize Winners will receive a $100.00 check and
promo codes
Let The Hunt Begin Sweepstakes | Lindt Chocolate, FIFTEEN (15) PRIZES: Each prize consists of a selection of seasonal Lindt chocolate products, including the iconic Lindt GOLD BUNNY(100g), Lindt GOLD BUNNY and EASTER FRIENDS Gift Bag, Bugs & Bees 5-pack hollow figures, Lindt Lil Chick 5-pack hollow figures, Lindt Mini Chick 5-pack hollow figures, Lindt Mini LGB 5-pack hollow figures, Lindt Sheep 5-pack hollow figures, Milk Chocolate Hens, Milk Chocolate Sheep, Lindt Chocolate Carrots 4-pack, LINDOR Spring Truffle 75ct Bag, Lindt Lil Chick House, Lindt GOLD BUNNY Story Book Gift, LINDOR Eggs Gift Bag, Lindt Carrot Cake Bar. ARV: $201.09/prize.
*Bump Club win a $200 Target Gift Card
&#8211; *Bump Club, giving away a $200 gift card to Nordstrom!
*Win a Limited Edition Men&#8217;s Timepiece &#8211; The Maris
Sara Lee 100 packs of Sara Lee Chocolate Chip cakes. ARV $399
2016-03- Contests | Movie-A-Day DVD Giveaway: Eve of Understanding
2016-03- Contests | Movie-A-Day DVD Giveaway: Brick Lane
2016-03- Contests | Movie-A-Day DVD Giveaway: My Life in Ruins
2016-03- Contests | Movie-A-Day DVD Giveaway: Undead
2016-03- Contests | Movie-A-Day DVD Giveaway: Alpha and Omega
2016-03- Contests | Movie-A-Day DVD Giveaway: Little Manhattan
TWEET $500 Amazon eGift Card
TWEET *, a Magformers Dinosaur 55 PC set! ($100 ARV)
TWEET Baby Video Monitor in Giftbox, RV $224.99
TWEET Kindle Fire (5th generation) & set of You and Hidden Bodies paperbacks
&#8211; TWEET Jamie Timbre (@jtimbre) | Twitter, daily chance to enter to win a Surface 3
&#8211; SHARE&#8230;LIKE&#8230; or COMMENT the DAILY POSTS ABOUT THE COMPETITION Country Life Girls 5 FREE Hoodies will be given away Friday!!!
TWEET *Cquel win a Bluetooth speaker from JBL, the Flip 2
TWEET Essential Oil Diffuser Aroma Ultasonic Atomizer
TWEET the Peanuts Movie Limited Edition DVD Gift Set
Winner&EUR(TM)s choice of one (1) Nissan vehicle with an actual retail value of up to forty thousand dollars ($40,000).
NEW TODAY!
10X EMAIL REFERRALS DAILY! Talbots win a trip to New York City. Plus, a $2,500 Talbots Gift Card.
NEW TODAY!
2016-03- Monday Beauty Giveaway THIS WEEK: Clarins Joli Rouge Brilliant set!(lipsticks)
NEW TODAY!
Three lucky winners will receive a Bonne Maman apron, shopping bag, and coupon for a free jar of Bonne Maman Preserves.
NEW TODAY!
Loretta Maimone win a $100 Visa Gift Card!
NEW TODAY!
NEW TODAY!
trip to Hollywood, California
NEW TODAY!
DIVINING ROD ADVENTURE SWEEPSTAKES trip to Wild Montana!
NEW TODAY!
P.S. This is just a small percentage of today&#8217;s complete collection of sweepstakes to be entered TODAY!& on how to get your hands on the complete list!
HOT SWEEPSTAKES TIPS
giving away a BMW! (And a bunch of computer gear)? (1x 8/3) ?
Play daily, every 3 hours, for daily $50 cash prize! Cash out all wins via Paypal. FACT: THEY PAY WITHIN HOURS!
win a 7-day European Boutique River Cruise for 2 in 2015. (1x 8/31)
$3,000 CASH Grand Prize, Daily draws of various gift cards (1x 8/14)
Winner will receive a check equal to either one month's mortgage or rent payment up to $1,500 (daily 8/31)
win 5 years of travel in the Caribbean, it's one 6 night stay, per year, for five individual years to various destinations within the Caribbean (1x 8/31)
win a $4,000 travel voucher and $1,000 check! (1x/wk 8/30)
Total ARV of all 64 levels of prizes: $728,840, Top level prize valued at $25,000 Timbertech Composite Decking and Railing, next two prizes cruises for example. Multiple winners at many levels of prizes. Good Luck, a good one to win! (daily 9/2)
win 1 of 2 $17,000 Travel Trailers! Take a Spin-to-Win Giveaway (daily 9/14)
$500 Cash and a Classical Books Bundle! (1x 9/24)
2014 Racing Edition Ford Focus (1X by 10/31)
win a $1,000 Amex Gift Card! 5 runner up $50 cards (1x 11/18)
win a Caribbean Cruise (1x unknown end)
Calendar of Previous Posts
9101112131415
16171819202122
23242526272829
Today on Powersweepstaking Twitter Updates
Recent Posts to this blog
&Welcome ,&&&&&I was featured in the TLC sweepstakes reality TV show "High Stakes Sweepers", originally airing on Sept. 3rd, 2011 and since, has shown up on several Discovery Channel owned cable stations (i.e., Discovery Fitness) through 2014. TLC was attempting to succeed with another 'Found Money" series, such as their hot 'Extreme Couponing', alas it never did make it past the pilot episode. In an effort to promote the show, the week before it originally aired, I appeared on ABC's Good Morning America (see the clip here):
&&&&&Discovery Channel's press release refers to me(Ron) in the 4th paragraph here: .
I also appeared on ABC's 20/20 news show as well (here's that clip):
&&&&&Join us as we talk about the show & sweepstakes entry strategies in our PowerSweepestaking community on , follow me on Twitter
or friend me on . &
TLC'S REALITY TV SHOW "HIGH STAKES SWEEPERS" Watch it for the first time or watch it again, HERE'S THE FULL SHOW!
&&&&&Every "High Stakes" sweeper new or old to the hobby, will profit from using all of the tools found throughout the Powersweepstaking web site. The most up to date database of sweepstakes including (YOUR BEST ODDS TO WIN IMHO!!)
&&&&&A Powersweepstaking subscription is the most organized method of entr YOU enter as many sweepstakes as possible in as little time that is available to you, whether it's ten minutes, half hour or even 2 hours and more(subscribe for as low as 2.97/mo.).
&&&&&An entry process that simply revolves around organization while remaining focused on entering! This is how you win, not reading rules, or searching. Without reading rules or searching YOU may REACH speeds of up to 100 entries an hour. For 10 cents a day see for yourself how subscribing ORGANIZES your sweepstakes entry process like never before! Try it NOW FREE and ANONYMOUSLY, through the categories of sweepstakes on the left menu above! See how our lists differ! FREE has ONE LIMITATION, that the database of sweeps published throughout the site may be anywhere from a day, a couple days, to a week old, not to mention pages with advertising. Subscribing will provide you access to daily updated sweeps, new sweeps added, expired sweeps removed, all WITHOUT ADVERTISEMENTS.
Subscribe through Paypal, again as little as 10 cents a day. Guaranteed (30 day money back guarantee) to be the most organized method of entering sweepstakes available on the Internet today!
subscriber RonC in an email wrote...
To: Ron Subject: Status update
Just wanted to update you on my power sweep(stak)ing progress.
Before I ever signed on for the full power sweep(stak)ing, I did read everything on your site, all the tips and instructions and did download and used the (FREE) low power to enter some sweeps.
I must commend you on the excellent program you have setup and manage on a daily basis. I can now do in minutes what it use to take me hours to do.
What a time saver.
You have certainly given me a time saver with your program and I appreciate it very much...
...Its excellent the way it is.
Thanks very much again, when I hit one of the big ones I'll buy you lunch, just let me know the location of your favorite restaurant.
&&&&&Your sweepstakes entry rate will soar, and this is NOT an automated entry method, YOU will visit every sponsor's page and click submit while YOU enter all of your favorite sweepstakes in a much more organized manner then any other way available! Otherwise, you can continue to try to organize using sweepstakes lists from everywhere and anywhere, from groups and message boards you search, read the rules, then and only then enter. That could take all day, all while entering only 100 or so. With Powersweepstaking, members can enter one hundred in an hour! To read &
understand more about
method of entering, visit .
subscriber Tiza... "...first day with full(subscription) powersweeps, ...amazed how many sweeps I
zoom(ed) through in record time. I think back how I have been entering
lately, ...VERY sidetracked in the sweep groups/boards, rules, etc. ..this
helps keep me on track. ..bit burned out lately, this has helped motivate
again. ...was spending more time browsing than actually sweeping"
&&&&&P.S. BRAND NEW as of 5/1/14 Powersweepstaking will use YOUR referral link, in our database, distributed to the hundreds of visitors and subscribers daily. Your FAVORITE or MOST IMPORTANT referral sweep can be featured on our site throughout it's entire entry period (i.e. if a sweep runs now through the end of the year, your link can be used the entire time). Would you like YOUR REFERRAL LINK to win a car, appliance, trip or cash be among the PowerSweepstaking database of sweeps. Some might subscribe JUST FOR THIS membership perk, it would cost less then $1.00 per link per month. So subscribe today and as an added extra for members, have as many as 5, 4 or 3 live links at any given time (max is 5 & is dependent on subscription level)! &&&&&Email me at
for more about POWERSWEEPSTAKING REFERRAL LINKS or anything else you may want to ask!subschema description entry的中文翻译及音标
沪江词库精选subschema description entry是什么意思、英语短语。
中文释义: 【计】 子模式描述体
久卧结石,久卧结石
褥疮,褥疮性溃疡
渐弱-渐强性杂音
2016subschema description entry是什么意思由沪江网提供。【图文】Subscriber Management_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
Subscriber Management
上传于||暂无简介
大小:727.50KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢

我要回帖

更多关于 subscriber id 的文章

 

随机推荐