本文整理汇总了Java中com.joepritzel.feather.PSBroker类的典型用法代码示例。如果您正苦于以下问题:Java PSBroker类的具体用法?Java PSBroker怎么用?Java PSBroker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PSBroker类属于com.joepritzel.feather包,在下文中一共展示了PSBroker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
public static void main(String[] args) {
final PSBroker broker = new PSBrokerBuilder().build();
new ConsoleCommandModule().bind(broker);
new NetworkingModule().bind(broker);
new NetworkingService(broker).start();
new CommandInputReaderService(broker).start();
}
示例2: JSONDecoder
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a new JSONDecoder with the given PSBroker.
*
* @param broker
* - The PSBroker to use.
*/
public JSONDecoder(PSBroker broker, NetworkingImplementation netImpl) {
this.broker = broker;
this.netImpl = netImpl;
broker.subscribe(new JSONDecoderRegisterReader(),
JSONDecoderRegister.class);
netImpl.addTypes(classTypeList);
classTypeList.add(IDAlreadyConnectedException.class);
}
示例3: setPSBroker
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
@Override
public void setPSBroker(PSBroker broker) {
if (f != null) {
throw new IllegalStateException(
"Can not change PSBroker once running.");
}
this.broker = broker;
}
示例4: bind
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
@Override
public void bind(PSBroker broker) {
broker.subscribe(new ExitConsoleCommandSubscriber());
}
示例5: bind
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
@Override
public void bind(PSBroker broker) {
// Add predicated subscribers that listen for packets with particular ids and then transform them to correct usable.
}
示例6: CommandInputReaderService
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
public CommandInputReaderService(PSBroker broker) {
this.broker = broker;
broker.subscribe(new ConsoleCommandParser(broker));
}
示例7: NetworkingService
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
public NetworkingService(PSBroker broker) {
this.broker = broker;
}
示例8: ConsoleCommandParser
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
public ConsoleCommandParser(PSBroker broker) {
this.broker = broker;
}
示例9: getBroker
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Returns the PSBroker that is used internally by this Server.
*/
public PSBroker getBroker() {
return broker;
}
示例10: RequestSubscriber
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a new RequestSubscriber with the given PSBroker,
* NetworkingImplementation, and QuoteFinder.
*
* @param broker
* - The PSBroker to use.
* @param netImpl
* - The NetworkingImplementation to use.
* @param quoteFinder
* - The QuoteFinder to use.
*/
public RequestSubscriber(PSBroker broker, NetworkingImplementation netImpl,
QuoteFinder quoteFinder) {
this.broker = broker;
this.netImpl = netImpl;
this.quoteFinder = quoteFinder;
}
示例11: Server
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a Server object.
*
* @param netImpl
* - The NetworkingImplementation to use.
* @param broker
* - The PSBroker to use.
*/
Server(NetworkingImplementation netImpl, PSBroker broker) {
this.netImpl = netImpl;
this.broker = broker;
this.netImpl.setPSBroker(broker);
this.decoder = new JSONDecoder(this.broker, this.netImpl);
this.broker.subscribe(decoder, JSONToObject.class);
}
示例12: Client
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a Client object.
*
* @param netImpl
* - The NetworkingImplementation to use.
* @param broker
* - The PSBroker to use.
*/
Client(NetworkingImplementation netImpl, PSBroker broker) {
this.netImpl = netImpl;
this.broker = broker;
this.netImpl.setPSBroker(broker);
this.decoder = new JSONDecoder(this.broker, this.netImpl);
this.broker.subscribe(decoder, JSONToObject.class);
}
示例13: StringReader
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a new StringReader subscriber.
*
* @param broker
* - The broker that is being used.
* @param netImpl
* - The NetworkingImplementation that is being used.
*/
public StringReader(PSBroker broker, NetworkingImplementation netImpl) {
this.broker = broker;
this.netImpl = netImpl;
}
示例14: StringSubscriber
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Creates a new StringSubscriber using the given broker and name.
*
* @param broker
* - The PSBroker this application uses.
* @param name
* - The name of this client.
*/
public StringSubscriber(PSBroker broker, String name) {
this.broker = broker;
this.name = name;
}
示例15: setBroker
import com.joepritzel.feather.PSBroker; //导入依赖的package包/类
/**
* Sets the PSBroker to use.
*
* @param broker
* - The PSBroker to use.
*/
public void setBroker(PSBroker broker) {
this.broker = broker;
}