brokertool.java

来自「Rakiura JFern是一个非常轻型的带有模拟器的Petri网络框架」· Java 代码 · 共 45 行

JAVA
45
字号
package org.rakiura.cpn.example.booking;/**/import java.util.Properties;/** * Represents a simple utility for a broker. * This class reads an input file, which must be * in standard Java properties format. The key is  * the name of the service, the value on/off defines * if the service is available or not. *  *<br><br> * BrokerTool.java<br> * Created: Thu Nov  1 00:36:16 2001<br> * * @author Mariusz Nowostawski (mariusz@rakiura.org) * @version $Revision: 1.1 $ $Date: 2001/10/31 12:36:58 $ */public class BrokerTool  {    Properties services = new Properties();  public BrokerTool(String filename) {    try {      services.load(new java.io.FileInputStream(filename));    } catch(java.io.IOException e){      e.printStackTrace();      System.exit(1);    }  }  public boolean isAvailable(String service){    if(services.get(service) != null &&       services.get(service).equals("on"))      return true;    else      return false;  }  } // BrokerTool//////////////////// end of file ////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?