static void Main(string[] args) { if (args.Length == 0) { Console.Write("Please input the java instruction file"); } else { string filename = args[0]; JavaExecutor executor = JavaExecutor.GetInstance(); executor.Execute(filename); } }
///<summary> /// Use the singleton pattern to create a unique object in the runtime ///<summary> public static JavaExecutor GetInstance() { if (_executor == null) { lock (_obj) { if (_executor == null) { _executor = new JavaExecutor(); } } } return(_executor); }