diff --git a/LICENSE.txt b/LICENSE.txt index 4d1d7969..36544294 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,5 @@ Nailgun Copyright © 2004-2012, Martian Software, Inc. +Copyright © 2017-present Facebook, Inc. Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index fa29dbf7..14846798 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,6 @@ you will additionally need to "make ng.exe". A ruby client is available through the [railgun](https://github.com/timuralp/railgun) project. -For more information, see [the nailgun website](http://martiansoftware.com/nailgun/). +For more information, see [the nailgun website](https://github.com/facebook/nailgun). diff --git a/nailgun-client/c/ng.c b/nailgun-client/c/ng.c index f98a705e..fee9c790 100644 --- a/nailgun-client/c/ng.c +++ b/nailgun-client/c/ng.c @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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. - */ /** @@ -42,7 +41,7 @@ #include #include -#define NAILGUN_VERSION "0.9.0" +#define NAILGUN_VERSION "1.0.0" #define BUFSIZE (2048) diff --git a/nailgun-client/py/ng.py b/nailgun-client/py/ng.py index f3f3011b..d4705a09 100644 --- a/nailgun-client/py/ng.py +++ b/nailgun-client/py/ng.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # # Copyright 2004-2015, Martian Software, Inc. +# Copyright 2017-Present Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,7 +56,7 @@ def bytes_to_str(bytes_to_convert): # # Please try to keep this working on Python 2.6. -NAILGUN_VERSION = "0.9.3" +NAILGUN_VERSION = "1.0.0" BUFSIZE = 2048 NAILGUN_PORT_DEFAULT = 2113 CHUNK_HEADER_LEN = 5 diff --git a/nailgun-client/py/test_ng.py b/nailgun-client/py/test_ng.py index bcbee060..1402daf0 100644 --- a/nailgun-client/py/test_ng.py +++ b/nailgun-client/py/test_ng.py @@ -1,3 +1,20 @@ +#!/usr/bin/env python +# +# Copyright 2004-2015, Martian Software, Inc. +# Copyright 2017-Present Facebook, Inc. +# +# Licensed 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. + import subprocess import os import time @@ -60,8 +77,8 @@ def setUpTransport(self): def getClassPath(self): cp = [ - "nailgun-server/target/nailgun-server-0.9.3-SNAPSHOT-uber.jar", - "nailgun-examples/target/nailgun-examples-0.9.3-SNAPSHOT.jar", + "nailgun-server/target/nailgun-server-1.0.0-SNAPSHOT-uber.jar", + "nailgun-examples/target/nailgun-examples-1.0.0-SNAPSHOT.jar", ] if os.name == "nt": return ";".join(cp) @@ -119,7 +136,7 @@ def preexec_fn(): + suspend ) cmd = cmd + [ - "com.martiansoftware.nailgun.NGServer", + "com.facebook.nailgun.NGServer", self.transport_address, str(self.heartbeat_timeout_ms), ] @@ -196,7 +213,7 @@ def test_nailgun_stats(self): exit_code = c.send_command("ng-stats") self.assertEqual(exit_code, 0) actual_out = output.getvalue().strip() - expected_out = "com.martiansoftware.nailgun.builtins.NGServerStats: 1/1" + expected_out = "com.facebook.nailgun.builtins.NGServerStats: 1/1" self.assertEqual(actual_out, expected_out) def test_nailgun_exit_code(self): @@ -206,7 +223,7 @@ def test_nailgun_exit_code(self): self.transport_address, stderr=None, stdin=None, stdout=output ) as c: exit_code = c.send_command( - "com.martiansoftware.nailgun.examples.Exit", [str(expected_exit_code)] + "com.facebook.nailgun.examples.Exit", [str(expected_exit_code)] ) self.assertEqual(exit_code, expected_exit_code) @@ -218,7 +235,7 @@ def test_nailgun_stdin(self): with NailgunConnection( self.transport_address, stderr=None, stdin=input, stdout=output ) as c: - exit_code = c.send_command("com.martiansoftware.nailgun.examples.Echo") + exit_code = c.send_command("com.facebook.nailgun.examples.Echo") self.assertEqual(exit_code, 0) actual_out = output.getvalue().strip() self.assertEqual(actual_out, echo) @@ -240,7 +257,7 @@ def test_nailgun_heartbeats(self): # just run Heartbeat nail for 5 seconds. During this period there should be # heartbeats received and printed back exit_code = c.send_command( - "com.martiansoftware.nailgun.examples.Heartbeat", ["5000"] + "com.facebook.nailgun.examples.Heartbeat", ["5000"] ) self.assertTrue(output.getvalue().count("H") > 10) @@ -254,7 +271,7 @@ def test_nailgun_no_heartbeat(self): heartbeat_interval_sec=0, ) as c: exit_code = c.send_command( - "com.martiansoftware.nailgun.examples.Heartbeat", ["3000"] + "com.facebook.nailgun.examples.Heartbeat", ["3000"] ) self.assertTrue(output.getvalue().count("H") == 0) @@ -269,7 +286,7 @@ def test_stress_nailgun_socket_close_without_race_condition(self): heartbeat_interval_sec=0.001, ) as c: exit_code = c.send_command( - "com.martiansoftware.nailgun.examples.Heartbeat", ["10"] + "com.facebook.nailgun.examples.Heartbeat", ["10"] ) self.assertEqual(exit_code, 0) @@ -301,7 +318,7 @@ def test_nailgun_disconnect(self): heartbeat_interval_sec=5, ) as c: exit_code = c.send_command( - "com.martiansoftware.nailgun.examples.Heartbeat", ["30000"] + "com.facebook.nailgun.examples.Heartbeat", ["30000"] ) self.assertTrue(output.getvalue().count("H") < 3) diff --git a/nailgun-examples/pom.xml b/nailgun-examples/pom.xml index b653fef2..0bd0b228 100644 --- a/nailgun-examples/pom.xml +++ b/nailgun-examples/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.martiansoftware + com.facebook nailgun-examples jar @@ -19,14 +19,14 @@ http://github.com/facebook/nailgun - com.martiansoftware + com.facebook nailgun-all - 0.9.3-SNAPSHOT + 1.0.0-SNAPSHOT - com.martiansoftware + com.facebook nailgun-server ${project.version} compile diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/DumpAll.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/DumpAll.java similarity index 94% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/DumpAll.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/DumpAll.java index 55b24734..24e1f5d7 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/DumpAll.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/DumpAll.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,12 +13,11 @@ 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; import java.util.TreeSet; /** diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Echo.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Echo.java similarity index 92% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Echo.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/Echo.java index cf6f5be7..cf05b91a 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Echo.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Echo.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; /** * Echos everything it reads from System.in to System.out. diff --git a/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Exit.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Exit.java new file mode 100644 index 00000000..f533e6de --- /dev/null +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Exit.java @@ -0,0 +1,36 @@ +/* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc + + Licensed 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 com.facebook.nailgun.examples; + +/** Finish nail with provided exit code */ +public class Exit { + + public static void main(String[] args) { + int exitCode = (int) ((Math.random() * 1000) + 1); + if (args.length > 0) { + try { + exitCode = Integer.parseInt(args[0]); + } catch (Exception e) { + } + } + // Close stdout to test the exit code is returned properly + // even in such case + System.out.close(); + System.exit(exitCode); + } +} diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Hash.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Hash.java similarity index 81% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Hash.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/Hash.java index f472fa47..568e0440 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Hash.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Hash.java @@ -1,24 +1,23 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; import java.security.MessageDigest; import java.security.Provider; import java.security.Security; diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Heartbeat.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Heartbeat.java similarity index 94% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Heartbeat.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/Heartbeat.java index 4b26605e..94f71737 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Heartbeat.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Heartbeat.java @@ -1,5 +1,4 @@ /* - Copyright 2004-2012, Jim Purbrick. Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,12 +12,11 @@ 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; import java.util.concurrent.atomic.AtomicBoolean; /** Print H for each heartbeat received */ diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/HelloWorld.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/HelloWorld.java similarity index 91% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/HelloWorld.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/HelloWorld.java index 6a1bb50c..be6e167e 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/HelloWorld.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/HelloWorld.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; /** * A truly amazing program that must be seen to be believed. diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Prompt.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Prompt.java similarity index 90% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Prompt.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/Prompt.java index 122f578a..2dc7b1af 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Prompt.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Prompt.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,12 +13,11 @@ 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; /** * Prompts the user for input using a JOptionPane, and displays the result to the client's stdout. diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Stack.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Stack.java similarity index 71% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Stack.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/Stack.java index 7b71a952..7d0946b8 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Stack.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/Stack.java @@ -1,25 +1,24 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; -import com.martiansoftware.nailgun.NGContext; -import com.martiansoftware.nailgun.NGServer; +import com.facebook.nailgun.NGContext; +import com.facebook.nailgun.NGServer; /** * Provides some nice command-line stack operations. This nail must have the aliases "push" and diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/ThreadTest.java b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/ThreadTest.java similarity index 60% rename from nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/ThreadTest.java rename to nailgun-examples/src/main/java/com/facebook/nailgun/examples/ThreadTest.java index f4977e2e..71a90c42 100644 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/ThreadTest.java +++ b/nailgun-examples/src/main/java/com/facebook/nailgun/examples/ThreadTest.java @@ -1,22 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun.examples; +package com.facebook.nailgun.examples; /** * A very silly test to verify that the System.in/out/err overrides are inherited by child threads. diff --git a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Exit.java b/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Exit.java deleted file mode 100644 index 71a10850..00000000 --- a/nailgun-examples/src/main/java/com/martiansoftware/nailgun/examples/Exit.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - -Copyright 2004-2012, Martian Software, Inc. - -Licensed 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 com.martiansoftware.nailgun.examples; - -/** Finish nail with provided exit code */ -public class Exit { - - public static void main(String[] args) { - int exitCode = (int) ((Math.random() * 1000) + 1); - if (args.length > 0) { - try { - exitCode = Integer.parseInt(args[0]); - } catch (Exception e) { - } - } - // Close stdout to test the exit code is returned properly - // even in such case - System.out.close(); - System.exit(exitCode); - } -} diff --git a/nailgun-server/pom.xml b/nailgun-server/pom.xml index edf0eef3..efde0137 100644 --- a/nailgun-server/pom.xml +++ b/nailgun-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.martiansoftware + com.facebook nailgun-server jar @@ -19,9 +19,9 @@ http://github.com/facebook/nailgun - com.martiansoftware + com.facebook nailgun-all - 0.9.3-SNAPSHOT + 1.0.0-SNAPSHOT @@ -59,7 +59,7 @@ true - com.martiansoftware.nailgun.NGServer + com.facebook.nailgun.NGServer @@ -80,7 +80,7 @@ false - com.martiansoftware.nailgun.NGServer + com.facebook.nailgun.NGServer diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/Alias.java b/nailgun-server/src/main/java/com/facebook/nailgun/Alias.java similarity index 97% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/Alias.java rename to nailgun-server/src/main/java/com/facebook/nailgun/Alias.java index 4a260a40..b3fb326d 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/Alias.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/Alias.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; /** * Provides a means to map memorable, short names to classes in order to make the issuing of diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/AliasManager.java b/nailgun-server/src/main/java/com/facebook/nailgun/AliasManager.java similarity index 82% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/AliasManager.java rename to nailgun-server/src/main/java/com/facebook/nailgun/AliasManager.java index 7e30649f..d8390b59 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/AliasManager.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/AliasManager.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import java.io.InputStream; import java.util.Iterator; @@ -44,7 +44,7 @@ public AliasManager() { cl = ClassLoader.getSystemClassLoader(); // needed if nailgun classes are loaded in the boot // classpath. try (InputStream is = - cl.getResourceAsStream("com/martiansoftware/nailgun/builtins/builtins.properties")) { + cl.getResourceAsStream("com/facebook/nailgun/builtins/builtins.properties")) { props.load(is); loadFromProperties(props); } catch (java.io.IOException e) { diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/CommandContext.java b/nailgun-server/src/main/java/com/facebook/nailgun/CommandContext.java similarity index 98% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/CommandContext.java rename to nailgun-server/src/main/java/com/facebook/nailgun/CommandContext.java index b6f354b7..b972df7b 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/CommandContext.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/CommandContext.java @@ -14,7 +14,7 @@ * under the License. */ -package com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.util.List; import java.util.Properties; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientDisconnectReason.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGClientDisconnectReason.java similarity index 56% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientDisconnectReason.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGClientDisconnectReason.java index 0376587d..42be1a50 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientDisconnectReason.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGClientDisconnectReason.java @@ -1,4 +1,20 @@ -package com.martiansoftware.nailgun; +/* + * Copyright 2018-present Facebook, Inc. + * + * Licensed 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 com.facebook.nailgun; /** * Used in NGClientListener callback to provide a reason why Nailgun server thinks that client is diff --git a/nailgun-server/src/main/java/com/facebook/nailgun/NGClientListener.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGClientListener.java new file mode 100644 index 00000000..d0be5d4a --- /dev/null +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGClientListener.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018-present Facebook, Inc. + * + * Licensed 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 com.facebook.nailgun; + +public interface NGClientListener { + + /** + * Called by an internal nailgun thread when the server detects that the nailgun client has + * disconnected. {@link NGClientListener}s can be registered using {@link + * NGContext#addClientListener}. + */ + void clientDisconnected(NGClientDisconnectReason reason); +} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGCommunicator.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java similarity index 99% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGCommunicator.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java index 6c35edf0..8038a1c3 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGCommunicator.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-present Facebook, Inc. + * Copyright 2018-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain @@ -14,7 +14,7 @@ * under the License. */ -package com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.ByteArrayInputStream; import java.io.Closeable; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGConstants.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGConstants.java similarity index 81% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGConstants.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGConstants.java index fabe0b08..ececaffa 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGConstants.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGConstants.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import java.io.InputStream; import java.util.Properties; @@ -83,7 +83,7 @@ private static String getVersion() { Properties props = new Properties(); try (InputStream is = NGConstants.class.getResourceAsStream( - "/META-INF/maven/com.martiansoftware/nailgun-server/pom.properties")) { + "/META-INF/maven/com.facebook/nailgun-server/pom.properties")) { props.load(is); } catch (Throwable e) { // In static initialization context, outputting or logging an exception is dangerous diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGContext.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGContext.java similarity index 90% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGContext.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGContext.java index f2cc894c..5aa6aefa 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGContext.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGContext.java @@ -1,22 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. - Copyright 2004-2012, Martian Software, Inc. + Licensed 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 - Licensed 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. + 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.InputStream; import java.io.PrintStream; @@ -258,10 +257,7 @@ public void removeAllClientListeners() { communicator.removeAllClientListeners(); } - /** - * @param listener the {@link com.martiansoftware.nailgun.NGHeartbeatListener} to be notified of - * client events. - */ + /** @param listener the {@link NGHeartbeatListener} to be notified of client events. */ public void addHeartbeatListener(NGHeartbeatListener listener) { communicator.addHeartbeatListener(listener); } diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGExitException.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGExitException.java similarity index 99% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGExitException.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGExitException.java index 02d3a024..4ef97251 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGExitException.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGExitException.java @@ -55,7 +55,7 @@ * information on the Apache Software Foundation, please see * . */ -package com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.PrintStream; diff --git a/nailgun-server/src/main/java/com/facebook/nailgun/NGHeartbeatListener.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGHeartbeatListener.java new file mode 100644 index 00000000..b05cdaab --- /dev/null +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGHeartbeatListener.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018-present Facebook, Inc. + * + * Licensed 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 com.facebook.nailgun; + +public interface NGHeartbeatListener { + + /** + * Called by an internal nailgun thread when the server receives a heartbeat from the client. This + * can normally be implemented as a no-op handler and is primarily useful for debugging. {@link + * NGClientListener}s can be registered using {@link NGContext.registerHeartbeatListener}. + */ + void heartbeatReceived(); +} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGInputStream.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGInputStream.java similarity index 96% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGInputStream.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGInputStream.java index cfb5c6eb..c7ebb9fd 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGInputStream.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGInputStream.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.IOException; import java.io.InputStream; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGListeningAddress.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGListeningAddress.java similarity index 80% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGListeningAddress.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGListeningAddress.java index 745ad270..02d87371 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGListeningAddress.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGListeningAddress.java @@ -1,21 +1,20 @@ /* - -Copyright 2004-2015, Martian Software, Inc. - -Licensed 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 com.martiansoftware.nailgun; + * Copyright 2018-present Facebook, Inc. + * + * Licensed 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 com.facebook.nailgun; import com.sun.jna.Platform; import java.net.InetAddress; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGNailNotFoundException.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGNailNotFoundException.java similarity index 96% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGNailNotFoundException.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGNailNotFoundException.java index 51807ed4..3d1224a0 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGNailNotFoundException.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGNailNotFoundException.java @@ -14,7 +14,7 @@ * under the License. */ -package com.martiansoftware.nailgun; +package com.facebook.nailgun; /** * Exception thrown if user-provided command does not match to any nail. It happens if command does diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGOutputStream.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGOutputStream.java similarity index 68% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGOutputStream.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGOutputStream.java index e3eb704f..b828817f 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGOutputStream.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGOutputStream.java @@ -1,22 +1,20 @@ /* + * Copyright 2018-present Facebook, Inc. + * + * Licensed 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. + */ - Copyright 2004-2012, Martian Software, Inc. - - Licensed 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.IOException; import java.io.OutputStream; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSecurityManager.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGSecurityManager.java similarity index 63% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSecurityManager.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGSecurityManager.java index 005e8ca9..5f3549f4 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSecurityManager.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGSecurityManager.java @@ -1,22 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.security.Permission; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGServer.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGServer.java similarity index 94% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGServer.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGServer.java index a17fdfbe..0bacb67d 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGServer.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGServer.java @@ -1,23 +1,23 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; -import com.martiansoftware.nailgun.builtins.DefaultNail; +package com.facebook.nailgun; + +import com.facebook.nailgun.builtins.DefaultNail; import com.sun.jna.Platform; import java.io.IOException; import java.io.InputStream; @@ -415,11 +415,11 @@ public void run() { } private static void usage() { - System.err.println("Usage: java com.martiansoftware.nailgun.NGServer"); - System.err.println(" or: java com.martiansoftware.nailgun.NGServer port"); - System.err.println(" or: java com.martiansoftware.nailgun.NGServer IPAddress"); - System.err.println(" or: java com.martiansoftware.nailgun.NGServer IPAddress:port"); - System.err.println(" or: java com.martiansoftware.nailgun.NGServer IPAddress:port timeout"); + System.err.println("Usage: java NGServer"); + System.err.println(" or: java NGServer port"); + System.err.println(" or: java NGServer IPAddress"); + System.err.println(" or: java NGServer IPAddress:port"); + System.err.println(" or: java NGServer IPAddress:port timeout"); } /** diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSession.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java similarity index 94% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSession.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java index fb30cd32..8ac4d3c6 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSession.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2012, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import java.io.IOException; import java.io.InputStream; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSessionPool.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGSessionPool.java similarity index 98% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSessionPool.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGSessionPool.java index 74c5c8da..305706a0 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGSessionPool.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGSessionPool.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.util.HashSet; import java.util.LinkedList; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainServerSocket.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainServerSocket.java similarity index 89% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainServerSocket.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainServerSocket.java index 55b3a574..d674b3f1 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainServerSocket.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainServerSocket.java @@ -1,21 +1,22 @@ /* + Copyright 2004-2015, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc. + Copyright 2017-Present Facebook, Inc -Copyright 2004-2015, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.LastErrorException; import com.sun.jna.Platform; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocket.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocket.java similarity index 86% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocket.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocket.java index 2797752c..c4f6e44d 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocket.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocket.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2015, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2015, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.LastErrorException; import java.io.IOException; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocketLibrary.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocketLibrary.java similarity index 86% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocketLibrary.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocketLibrary.java index 15f4b511..c71486c4 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGUnixDomainSocketLibrary.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGUnixDomainSocketLibrary.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2015, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2015, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.LastErrorException; import com.sun.jna.Native; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeLibrary.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeLibrary.java similarity index 70% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeLibrary.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeLibrary.java index e86843aa..b17e901f 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeLibrary.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeLibrary.java @@ -1,21 +1,22 @@ /* + Copyright 2004-2017, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2017, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.*; import com.sun.jna.platform.win32.WinNT; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeServerSocket.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeServerSocket.java similarity index 90% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeServerSocket.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeServerSocket.java index f87c9b3e..779002a8 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeServerSocket.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeServerSocket.java @@ -1,21 +1,22 @@ /* + Copyright 2004-2017, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2017, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.platform.win32.WinBase; import com.sun.jna.platform.win32.WinError; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeSocket.java b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeSocket.java similarity index 89% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeSocket.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeSocket.java index 334d7836..8e88bfa4 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGWin32NamedPipeSocket.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NGWin32NamedPipeSocket.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2017, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2017, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.Memory; import com.sun.jna.platform.win32.WinBase; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NailStats.java b/nailgun-server/src/main/java/com/facebook/nailgun/NailStats.java similarity index 97% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/NailStats.java rename to nailgun-server/src/main/java/com/facebook/nailgun/NailStats.java index 213ab7bb..14403e2c 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NailStats.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NailStats.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; /** * Collects and provides statistics on a nail. diff --git a/nailgun-server/src/main/java/com/facebook/nailgun/NonStaticNail.java b/nailgun-server/src/main/java/com/facebook/nailgun/NonStaticNail.java new file mode 100644 index 00000000..74bb3a2d --- /dev/null +++ b/nailgun-server/src/main/java/com/facebook/nailgun/NonStaticNail.java @@ -0,0 +1,29 @@ +/* + Copyright 2004-2017, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. + + Licensed 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 com.facebook.nailgun; + +/** + * Allows providing a instance (non-static) main method. Potentially helpful for users of JVM + * languages other than Java. + * + *

Implementations of this interface MUST provide a public, no-args constructor. + */ +public interface NonStaticNail { + + public void nailMain(String[] args); +} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ReferenceCountedFileDescriptor.java b/nailgun-server/src/main/java/com/facebook/nailgun/ReferenceCountedFileDescriptor.java similarity index 68% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/ReferenceCountedFileDescriptor.java rename to nailgun-server/src/main/java/com/facebook/nailgun/ReferenceCountedFileDescriptor.java index ff7b4049..82d230d1 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ReferenceCountedFileDescriptor.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/ReferenceCountedFileDescriptor.java @@ -1,21 +1,21 @@ /* + Copyright 2004-2015, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. -Copyright 2004-2015, Martian Software, Inc. + Licensed 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 -Licensed 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. + 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 com.martiansoftware.nailgun; + +package com.facebook.nailgun; import com.sun.jna.LastErrorException; import java.io.IOException; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalInputStream.java b/nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalInputStream.java similarity index 98% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalInputStream.java rename to nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalInputStream.java index 235bd56d..2edfcab7 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalInputStream.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalInputStream.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.IOException; import java.io.InputStream; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalPrintStream.java b/nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalPrintStream.java similarity index 98% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalPrintStream.java rename to nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalPrintStream.java index 237ea87d..13411c4c 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/ThreadLocalPrintStream.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/ThreadLocalPrintStream.java @@ -1,6 +1,6 @@ /* - Copyright 2004-2012, Martian Software, Inc. + Copyright 2017-Present Facebook, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,10 +13,9 @@ 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 com.martiansoftware.nailgun; +package com.facebook.nailgun; import java.io.IOException; import java.io.PrintStream; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/DefaultNail.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/DefaultNail.java similarity index 87% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/DefaultNail.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/DefaultNail.java index 82a660c2..56843430 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/DefaultNail.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/DefaultNail.java @@ -1,6 +1,7 @@ /* Copyright 2004-2012, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,10 +17,10 @@ */ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.NGConstants; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGConstants; +import com.facebook.nailgun.NGContext; /** * The default nail class used by the server when an invalid command (nonexisting classname or diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGAlias.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGAlias.java similarity index 93% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGAlias.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGAlias.java index 8fd88861..bc7d1215 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGAlias.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGAlias.java @@ -1,6 +1,7 @@ /* Copyright 2004-2012, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,11 +17,11 @@ */ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.Alias; -import com.martiansoftware.nailgun.NGContext; -import com.martiansoftware.nailgun.NGServer; +import com.facebook.nailgun.Alias; +import com.facebook.nailgun.NGContext; +import com.facebook.nailgun.NGServer; import java.util.Iterator; import java.util.Set; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGClasspath.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGClasspath.java similarity index 96% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGClasspath.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGClasspath.java index 7c30b63e..9f508599 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGClasspath.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGClasspath.java @@ -1,6 +1,7 @@ /* Copyright 2004-2012, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,9 +17,9 @@ */ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; import java.io.File; import java.net.URL; import java.net.URLClassLoader; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGServerStats.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGServerStats.java similarity index 90% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGServerStats.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGServerStats.java index ea5fe08b..cab01911 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGServerStats.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGServerStats.java @@ -1,6 +1,7 @@ /* Copyright 2004-2012, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,10 +17,10 @@ */ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.NGContext; -import com.martiansoftware.nailgun.NGServer; +import com.facebook.nailgun.NGContext; +import com.facebook.nailgun.NGServer; import java.util.Iterator; import java.util.Map; diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGStop.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGStop.java similarity index 90% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGStop.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGStop.java index caf44ecf..39765b52 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGStop.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGStop.java @@ -1,6 +1,7 @@ /* Copyright 2004-2012, Martian Software, Inc. +Copyright 2017-Present Facebook, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,9 +17,9 @@ */ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGContext; /** * Shuts down the currently running server. diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGVersion.java b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGVersion.java similarity index 68% rename from nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGVersion.java rename to nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGVersion.java index d6491f78..c70fa602 100644 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/builtins/NGVersion.java +++ b/nailgun-server/src/main/java/com/facebook/nailgun/builtins/NGVersion.java @@ -1,7 +1,7 @@ -package com.martiansoftware.nailgun.builtins; +package com.facebook.nailgun.builtins; -import com.martiansoftware.nailgun.NGConstants; -import com.martiansoftware.nailgun.NGContext; +import com.facebook.nailgun.NGConstants; +import com.facebook.nailgun.NGContext; /** * Displays the version of the NailGun server and exits. diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientListener.java b/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientListener.java deleted file mode 100644 index d1e8fa3d..00000000 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGClientListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.martiansoftware.nailgun; - -public interface NGClientListener { - - /** - * Called by an internal nailgun thread when the server detects that the nailgun client has - * disconnected. {@link NGClientListener}s can be registered using {@link - * NGContext#addClientListener}. - */ - void clientDisconnected(NGClientDisconnectReason reason); -} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGHeartbeatListener.java b/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGHeartbeatListener.java deleted file mode 100644 index f5696eb3..00000000 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NGHeartbeatListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.martiansoftware.nailgun; - -public interface NGHeartbeatListener { - - /** - * Called by an internal nailgun thread when the server receives a heartbeat from the client. This - * can normally be implemented as a no-op handler and is primarily useful for debugging. {@link - * NGClientListener}s can be registered using {@link NGContext.registerHeartbeatListener}. - */ - void heartbeatReceived(); -} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NonStaticNail.java b/nailgun-server/src/main/java/com/martiansoftware/nailgun/NonStaticNail.java deleted file mode 100644 index cc422a87..00000000 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/NonStaticNail.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.martiansoftware.nailgun; - -/** - * Allows providing a instance (non-static) main method. Potentially helpful for users of JVM - * languages other than Java. - * - *

Implementations of this interface MUST provide a public, no-args constructor. - */ -public interface NonStaticNail { - - public void nailMain(String[] args); -} diff --git a/nailgun-server/src/main/java/com/martiansoftware/nailgun/nailgun-version.properties b/nailgun-server/src/main/java/com/martiansoftware/nailgun/nailgun-version.properties deleted file mode 100644 index 9ddc69ad..00000000 --- a/nailgun-server/src/main/java/com/martiansoftware/nailgun/nailgun-version.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Automatically generated by Ant build script. -#Fri May 22 21:04:25 EDT 2009 -version=0.9.0 diff --git a/nailgun-server/src/main/resources/com/facebook/nailgun/builtins/builtins.properties b/nailgun-server/src/main/resources/com/facebook/nailgun/builtins/builtins.properties new file mode 100644 index 00000000..c107ec89 --- /dev/null +++ b/nailgun-server/src/main/resources/com/facebook/nailgun/builtins/builtins.properties @@ -0,0 +1,14 @@ +ng-alias=com.facebook.nailgun.builtins.NGAlias +ng-alias.desc=Displays and manages command aliases + +ng-cp=com.facebook.nailgun.builtins.NGClasspath +ng-cp.desc=Displays and manages the current system classpath + +ng-stop=com.facebook.nailgun.builtins.NGStop +ng-stop.desc=Shuts down the nailgun server + +ng-stats=com.facebook.nailgun.builtins.NGServerStats +ng-stats.desc=Displays nail statistics + +ng-version=com.facebook.nailgun.builtins.NGVersion +ng-version.desc=Displays the server version number. diff --git a/nailgun-server/src/main/resources/com/martiansoftware/nailgun/builtins/builtins.properties b/nailgun-server/src/main/resources/com/martiansoftware/nailgun/builtins/builtins.properties deleted file mode 100644 index c980e09c..00000000 --- a/nailgun-server/src/main/resources/com/martiansoftware/nailgun/builtins/builtins.properties +++ /dev/null @@ -1,14 +0,0 @@ -ng-alias=com.martiansoftware.nailgun.builtins.NGAlias -ng-alias.desc=Displays and manages command aliases - -ng-cp=com.martiansoftware.nailgun.builtins.NGClasspath -ng-cp.desc=Displays and manages the current system classpath - -ng-stop=com.martiansoftware.nailgun.builtins.NGStop -ng-stop.desc=Shuts down the nailgun server - -ng-stats=com.martiansoftware.nailgun.builtins.NGServerStats -ng-stats.desc=Displays nail statistics - -ng-version=com.martiansoftware.nailgun.builtins.NGVersion -ng-version.desc=Displays the server version number. diff --git a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGCommunicatorTest.java b/nailgun-server/src/test/java/com/facebook/nailgun/NGCommunicatorTest.java similarity index 78% rename from nailgun-server/src/test/java/com/martiansoftware/nailgun/NGCommunicatorTest.java rename to nailgun-server/src/test/java/com/facebook/nailgun/NGCommunicatorTest.java index 20c69713..ad021c8f 100644 --- a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGCommunicatorTest.java +++ b/nailgun-server/src/test/java/com/facebook/nailgun/NGCommunicatorTest.java @@ -1,4 +1,22 @@ -package com.martiansoftware.nailgun; +/* + +Copyright 2017-present Facebook, Inc. + +Licensed 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 com.facebook.nailgun; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGServerTest.java b/nailgun-server/src/test/java/com/facebook/nailgun/NGServerTest.java similarity index 82% rename from nailgun-server/src/test/java/com/martiansoftware/nailgun/NGServerTest.java rename to nailgun-server/src/test/java/com/facebook/nailgun/NGServerTest.java index 2803d7ef..a980adcc 100644 --- a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGServerTest.java +++ b/nailgun-server/src/test/java/com/facebook/nailgun/NGServerTest.java @@ -1,10 +1,27 @@ -package com.martiansoftware.nailgun; +/* + +Copyright 2017-present Facebook, Inc. + +Licensed 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 com.facebook.nailgun; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeFalse; -import com.martiansoftware.nailgun.builtins.NGVersion; +import com.facebook.nailgun.builtins.NGVersion; import com.sun.jna.Platform; import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionPoolTest.java b/nailgun-server/src/test/java/com/facebook/nailgun/NGSessionPoolTest.java similarity index 77% rename from nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionPoolTest.java rename to nailgun-server/src/test/java/com/facebook/nailgun/NGSessionPoolTest.java index 0ccfd74a..c0477988 100644 --- a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionPoolTest.java +++ b/nailgun-server/src/test/java/com/facebook/nailgun/NGSessionPoolTest.java @@ -1,4 +1,21 @@ -package com.martiansoftware.nailgun; +/* + +Copyright 2017-present Facebook, Inc. + +Licensed 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 com.facebook.nailgun; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionTest.java b/nailgun-server/src/test/java/com/facebook/nailgun/NGSessionTest.java similarity index 86% rename from nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionTest.java rename to nailgun-server/src/test/java/com/facebook/nailgun/NGSessionTest.java index 522115ce..6f643a30 100644 --- a/nailgun-server/src/test/java/com/martiansoftware/nailgun/NGSessionTest.java +++ b/nailgun-server/src/test/java/com/facebook/nailgun/NGSessionTest.java @@ -1,4 +1,21 @@ -package com.martiansoftware.nailgun; +/* + +Copyright 2017-present Facebook, Inc. + +Licensed 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 com.facebook.nailgun; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; diff --git a/pom.xml b/pom.xml index d85c6a2e..217c3ae0 100644 --- a/pom.xml +++ b/pom.xml @@ -8,9 +8,9 @@ 7 - com.martiansoftware + com.facebook nailgun-all - 0.9.3-SNAPSHOT + 1.0.0-SNAPSHOT pom @@ -42,7 +42,7 @@ scm:git:git@github.com:facebook/nailgun.git scm:git:git@github.com:facebook/nailgun.git scm:git:git@github.com:facebook/nailgun.git - nailgun-all-0.9.3 + nailgun-all-1.0.0