代码是HornetQ中示例程序的client-side-load-balancing项目。public class ClientSideLoadBalancingExample extends HornetQExample
{
public static void main(final String[] args)
{
new ClientSideLoadBalancingExample().run(args);
}
}
被调用代码如下public abstract class HornetQExample
{
protected static Logger log = Logger.getLogger(HornetQExample.class.getName()); private Process[] servers; protected boolean failure = false; protected String serverClasspath; protected String serverProps; public abstract boolean runExample() throws Exception; private boolean logServerOutput; protected String[] configs;
protected boolean runServer; protected void run(final String[] configs)
{
String runServerProp = System.getProperty("hornetq.example.runServer");
String logServerOutputProp = System.getProperty("hornetq.example.logserveroutput");
serverClasspath = System.getProperty("hornetq.example.server.classpath");
runServer = runServerProp == null ? true : Boolean.valueOf(runServerProp);
logServerOutput = logServerOutputProp == null ? false : Boolean.valueOf(logServerOutputProp);
serverProps = System.getProperty("hornetq.example.server.args");
if (System.getProperty("hornetq.example.server.override.args") != null)
{
serverProps = System.getProperty("hornetq.example.server.override.args");
}
System.out.println("serverProps = " + serverProps);
HornetQExample.log.info("hornetq.example.runServer is " + runServer); this.configs = configs; try
{
if (runServer)
{
startServers();
} if (!runExample())
{
failure = true;
}
System.out.println("example complete");
}
catch (Throwable e)
{
failure = true;
e.printStackTrace();
}
finally
{
if (runServer)
{
try
{
stopServers();
}
catch (Throwable throwable)
{
throwable.printStackTrace();
}
}
}
reportResultAndExit();
}这上面的System.getProperty(“*********”)让我迷惑好久,都不知道是什么意思!
不知道跟项目路径有没有关系。
Java
{
public static void main(final String[] args)
{
new ClientSideLoadBalancingExample().run(args);
}
}
被调用代码如下public abstract class HornetQExample
{
protected static Logger log = Logger.getLogger(HornetQExample.class.getName()); private Process[] servers; protected boolean failure = false; protected String serverClasspath; protected String serverProps; public abstract boolean runExample() throws Exception; private boolean logServerOutput; protected String[] configs;
protected boolean runServer; protected void run(final String[] configs)
{
String runServerProp = System.getProperty("hornetq.example.runServer");
String logServerOutputProp = System.getProperty("hornetq.example.logserveroutput");
serverClasspath = System.getProperty("hornetq.example.server.classpath");
runServer = runServerProp == null ? true : Boolean.valueOf(runServerProp);
logServerOutput = logServerOutputProp == null ? false : Boolean.valueOf(logServerOutputProp);
serverProps = System.getProperty("hornetq.example.server.args");
if (System.getProperty("hornetq.example.server.override.args") != null)
{
serverProps = System.getProperty("hornetq.example.server.override.args");
}
System.out.println("serverProps = " + serverProps);
HornetQExample.log.info("hornetq.example.runServer is " + runServer); this.configs = configs; try
{
if (runServer)
{
startServers();
} if (!runExample())
{
failure = true;
}
System.out.println("example complete");
}
catch (Throwable e)
{
failure = true;
e.printStackTrace();
}
finally
{
if (runServer)
{
try
{
stopServers();
}
catch (Throwable throwable)
{
throwable.printStackTrace();
}
}
}
reportResultAndExit();
}这上面的System.getProperty(“*********”)让我迷惑好久,都不知道是什么意思!
不知道跟项目路径有没有关系。
Java
解决方案 »
- struts2中action里怎么判断数据库拿到的值和页面输入的值相不相等
- spring 3.0 restful
- 菜鸟问题,初学JAVA 写了个小程序有问题,大家帮忙看下 谢谢了 在线等
- 怎么改java的police文件
- could not initialize a collection: [com.db.tarena.crm.order.entity.Order.product#2]
- SocketServer怎么批量获取网络摄像机图片
- 学了下ejb和struts,想看看hibernate和spring
- weblogic的问题?
- Jbuilder7、CMP、查找所有记录,编译出错?
- 对dom进行修改后输出到xml文件时的问题
- java类调用问题
- 向数据库里添加数据,如果数据库有同名的,则新的数据覆盖旧的数据,有办法实现吗???
取得系统的环境变量,例如System.getProperty("PATH") 会返回 PATH的值
String logServerOutputProp = System.getProperty("hornetq.example.logserveroutput");
serverClasspath = System.getProperty("hornetq.example.server.classpath");系统没有hornetq.example.runServer这样的变量啊!这可能是什么呢?
原来hornetq.example.runServer这些字符串的值是通过ANT设置的。