资源简介
dubbo开发必要插件zookeper,dubbo开发必要插件zookeper,dubbo开发必要插件zookeper
代码片段和文件信息
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License Version 2.0 (the
* “License“); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zookeeper.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
/**
* This is a generic Main class that is completely driven by the
* /mainClasses resource on the class path. This resource has the
* format:
*
* cmd:mainClass:Description
*
* Any lines starting with # will be skipped
*
*/
public class FatJarMain {
static class Cmd {
Cmd(String cmd String clazz String desc) {
this.cmd = cmd;
this.clazz = clazz;
this.desc = desc;
}
String cmd;
String clazz;
String desc;
}
static HashMap cmds = new HashMap();
static ArrayList order = new ArrayList();
/**
* @param args the first parameter of args will be used as an
* index into the /mainClasses resource. The rest will be passed
* to the mainClass to run.
* @throws IOException
* @throws ClassNotFoundException
* @throws NoSuchMethodException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public static void main(String[] args) throws IOException ClassNotFoundException SecurityException NoSuchMethodException IllegalArgumentException IllegalAccessException {
InputStream is = FatJarMain.class.getResourceAsStream(“/mainClasses“);
if (is == null) {
System.err.println(“Couldn‘t find /mainClasses in classpath.“);
System.exit(3);
}
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line;
while((line = br.readLine()) != null) {
String parts[] = line.split(“:“ 3);
if (parts.length != 3 || (parts[0].length() > 0 && parts[0].charAt(0) == ‘#‘)) {
continue;
}
if (parts[0].length() > 0) {
cmds.put(parts[0] new Cmd(parts[0] parts[1] parts[2]));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-15 16:38 zookeeper-3.4.8\
文件 6148 2017-03-13 15:21 zookeeper-3.4.8\.DS_Store
目录 0 2017-08-01 16:02 __MACOSX\
目录 0 2017-08-01 16:02 __MACOSX\zookeeper-3.4.8\
文件 120 2017-03-13 15:21 __MACOSX\zookeeper-3.4.8\._.DS_Store
目录 0 2016-07-12 19:45 zookeeper-3.4.8\bin\
文件 232 2016-02-06 11:46 zookeeper-3.4.8\bin\README.txt
目录 0 2017-08-01 16:02 __MACOSX\zookeeper-3.4.8\bin\
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._README.txt
文件 1937 2016-02-06 11:46 zookeeper-3.4.8\bin\zkCleanup.sh
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkCleanup.sh
文件 1056 2016-02-06 11:46 zookeeper-3.4.8\bin\zkCli.cmd
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkCli.cmd
文件 1534 2016-02-06 11:46 zookeeper-3.4.8\bin\zkCli.sh
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkCli.sh
文件 1628 2016-02-06 11:46 zookeeper-3.4.8\bin\zkEnv.cmd
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkEnv.cmd
文件 2696 2016-02-06 11:46 zookeeper-3.4.8\bin\zkEnv.sh
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkEnv.sh
文件 1089 2016-02-06 11:46 zookeeper-3.4.8\bin\zkServer.cmd
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkServer.cmd
文件 6773 2016-02-06 11:46 zookeeper-3.4.8\bin\zkServer.sh
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\bin\._zkServer.sh
文件 172 2016-07-12 19:45 __MACOSX\zookeeper-3.4.8\._bin
文件 83235 2016-02-06 11:46 zookeeper-3.4.8\build.xm
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\._build.xm
文件 88625 2016-02-06 11:46 zookeeper-3.4.8\CHANGES.txt
文件 172 2016-02-06 11:46 __MACOSX\zookeeper-3.4.8\._CHANGES.txt
目录 0 2016-07-12 19:50 zookeeper-3.4.8\conf\
文件 535 2016-02-06 11:46 zookeeper-3.4.8\conf\configuration.xsl
目录 0 2017-08-01 16:02 __MACOSX\zookeeper-3.4.8\conf\
............此处省略4183个文件信息
- 上一篇:我的自用AD元件库飞思卡尔比赛
- 下一篇:AGC_VCA821自动增益控制电路
评论
共有 条评论