MessageTargetFactory.java :  » Network » prpl-junction-tictactoe » edu » stanford » junction » api » messaging » target » Android Open Source

Android Open Source » Network » prpl junction tictactoe 
prpl junction tictactoe » edu » stanford » junction » api » messaging » target » MessageTargetFactory.java
package edu.stanford.junction.api.messaging.target;

import edu.stanford.junction.Junction;

public class MessageTargetFactory {
  private Junction jx;
  
  public static MessageTargetFactory getInstance(Junction jx) {
    return new MessageTargetFactory(jx);
  }
  
  private MessageTargetFactory(Junction jx) {
    this.jx=jx;
  }
  
  public MessageTarget getTarget(String target) {
    if (target.equals("session")) {
      return new Session(jx);
    }
    
    if (target.startsWith("actor:")) {
      return new Actor(jx,target.substring(6));
    }
    
    return null;
  }
  
  
  
  
  
  
  
  
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.