Permalink
Browse files

Fixed gradle command in READMEs

  • Loading branch information...
dturanski committed Sep 13, 2012
1 parent 2a07582 commit d69afffa700073ccd103e48a54eebb9ac1af3b01
View
@@ -36,11 +36,11 @@ These examples demonstrate additional GemFire features and require a full instal
This project is built with gradle and each example may be run with gradle or within your Java IDE. If you are using Eclipse or SpringSource Tool Suite, go to the directory where you downloaded this project and type:
- gradle eclipse
+ ./gradlew eclipse
If you are using IDEA,
- gradle idea
+ ./gradlew idea
Detailed instructions for each example may be found in its own README file.
@@ -11,15 +11,15 @@ If you have downloaded the trial version, you will need to obtain a key from Gem
To run this example, Open a command window and start two locators:
- gradle -q start-locator-10334
- gradle -q start-locator-10335
+ ./gradlew -q start-locator-10334
+ ./gradlew -q start-locator-10335
Start one of the processes:
- gradle -q run-gateway -Pmain=NewYork
+ ./gradlew -q run-gateway -Pmain=NewYork
In another command window, run:
- gradle -q run-gateway -Pmain=London
+ ./gradlew -q run-gateway -Pmain=London
Each of these initializes an Order region which is gateway enabled and a gateway hub. Since each process uses a different locator, and multicast is disabled (mcast-port=0), each cache runs in a separate Distributed System, simulating two remote installations. Both processes will prompt you to press ENTER to update the region. Wait for both processes to start first. You should see a log message from the remote process's LoggingCacheListener indicating the remote region was updated. Press ENTER a second time to terminate the process.
@@ -9,23 +9,23 @@ This example creates simple a client server system to demonstrate what happens w
Start two locators:
- gradle -q start-locator-10334
- gradle -q start-locator-10335
+ ./gradlew -q start-locator-10334
+ ./gradlew -q start-locator-10335
Start the server:
- gradle -q run-locator-failover -Pmain=Server
+ ./gradlew -q run-locator-failover -Pmain=Server
Start the client:
- gradle -q run-locator-failover -Pmain=Client
+ ./gradlew -q run-locator-failover -Pmain=Client
The client will create two Customer entries which will be indicated by Server log messages.
When prompted in the client, stop the primary locator:
- gradle -q stop-locator-10334
+ ./gradlew -q stop-locator-10334
The client will create two more Customer entries.
@@ -17,15 +17,18 @@
import java.io.IOException;
+import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Server {
public static void main(String args[]) throws IOException {
- new ClassPathXmlApplicationContext("server/cache-config.xml");
+ ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("server/cache-config.xml");
+ ac.registerShutdownHook();
System.out.println("Press <Enter> to terminate the server");
System.in.read();
+ ac.close();
System.exit(0);
}
}
View
@@ -5,16 +5,16 @@ This example demonstrates the use of GemFire's Function Execution Service config
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-function -Pmain=Server
+ ./gradlew -q run-function -Pmain=Server
Open a second command window, and type:
- gradle -q run-function -Pmain=Client
+ ./gradlew -q run-function -Pmain=Client
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run the above.
@@ -5,17 +5,17 @@ This demonstrates using Spring Data GemFire to create a partitioned region. The
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-partitioned -Pmain=Server
+ ./gradlew -q run-partitioned -Pmain=Server
Open a second command window and repeat the above command
When both servers are running, open a third window, and type:
- gradle -q run-partitioned -Pmain=Client
+ ./gradlew -q run-partitioned -Pmain=Client
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run the above classes
@@ -29,7 +29,7 @@ The example also includes a custom PartitionResolver (CountryPartitionResolver)
In the server command windows, run the servers again, but each with a different active profile:
- gradle -q run-partitioned -Pmain=Server -Pargs=US
- gradle -q run-partitioned -Pmain=Server -Pargs=UK
+ ./gradlew -q run-partitioned -Pmain=Server -Pargs=US
+ ./gradlew -q run-partitioned -Pmain=Server -Pargs=UK
Run the client again. This time, you will observe that all the odd numbered orders go to "UK" and the evens go to "US"
@@ -5,12 +5,12 @@ This demonstrates using Spring Data GemFire to create persistent regions. Persis
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-persistence
+ ./gradlew -q run-persistence
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
@@ -5,16 +5,16 @@ This demonstrates using Spring Data GemFire to create a replicated region. The d
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-replicate-cs -Pmain=Server
+ ./gradlew -q run-replicate-cs -Pmain=Server
Open a second command window, and type:
- gradle -q run-replicate-cs -Pmain=Client
+ ./gradlew -q run-replicate-cs -Pmain=Client
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run the above.
@@ -5,16 +5,16 @@ This demonstrates using Spring Data GemFire to create a replicated region. The d
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-replicate -Pmain=Consumer
+ ./gradlew -q run-replicate -Pmain=Consumer
When instructed, open a second command window, and type:
- gradle -q run-replicate -Pmain=Producer
+ ./gradlew -q run-replicate -Pmain=Producer
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run the above classes
@@ -6,16 +6,16 @@ may be done synchronously (write-through) or asynchronously (write-behind).
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-write-through
+ ./gradlew -q run-write-through
To demonstrate write-behind, pass an 'async' argument to the command line:
- gradle -q run-write-through -Pargs=async
+ ./gradlew -q run-write-through -Pargs=async
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
View
@@ -9,16 +9,16 @@ configures a CQ Listener which handles CQ Events received.
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-cq -Pmain=Server
+ ./gradlew -q run-cq -Pmain=Server
in another window:
- gradle -q run-qc -Pmain=Client
+ ./gradlew -q run-qc -Pmain=Client
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run the above classes
@@ -5,12 +5,12 @@ This demonstrates Spring Framework's GemfireTemplate to access the Gemfire cache
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-gemfire-template
+ ./gradlew -q run-gemfire-template
Or to run from your IDE, run the following command once for all projects.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
@@ -6,18 +6,18 @@ allow you to run this example with or without PDX serialization enabled.
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-repository
+ ./gradlew -q run-repository
-To run with PDX, supply a command line argument, which is done in gradle as follows:
+To run with PDX, supply a command line argument, which is done in ./gradlew as follows:
- gradle -q run-repository -Pargs=pdx
+ ./gradlew -q run-repository -Pargs=pdx
If pdx is enabled you will see some files created in the 'pdx' folder.
Or to run from your IDE, run one of the following commands once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
@@ -5,12 +5,12 @@ This demonstrates Spring Framework's @Cacheable annotation backed by GemFire.
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-spring-cache
+ ./gradlew -q run-spring-cache
Or to run from your IDE, execute one of the following tasks once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
@@ -6,12 +6,12 @@ a customer in the Customer region and then performs an update which throws an ex
To run this example, open a command window, go to the the spring-gemfire-examples root directory, and type:
- gradle -q run-transaction
+ ./gradlew -q run-transaction
Or to run from your IDE, run one of the following commands once.
- gradle eclipse
- gradle idea
+ ./gradlew eclipse
+ ./gradlew idea
Then import the project into your IDE and run Main.java
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
@@ -53,9 +54,10 @@ public static void main(String args[]) {
/*
* If using the default, create the directory
*/
+ File locatorDir = null;
if (workingDir == null) {
workingDir = new File(".").getAbsolutePath() + File.separator + "locator" + port;
- File locatorDir = new File(workingDir);
+ locatorDir = new File(workingDir);
if (!locatorDir.exists()) {
locatorDir.mkdir();
}
@@ -64,7 +66,7 @@ public static void main(String args[]) {
* If directory passed as a command argument, it must exist
*/
else {
- File locatorDir = new File (workingDir);
+ locatorDir = new File (workingDir);
if (!locatorDir.exists()) {
System.err.println(" Directory " + workingDir + " does not exist.");
System.exit(1);
@@ -115,6 +117,17 @@ public static void main(String args[]) {
}
if (options.get("command").equals("start")) {
+
+ for (File file : locatorDir.listFiles( new FilenameFilter(){
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".log") || name.endsWith(".dat");
+ }
+
+ }) ){
+ file.delete();
+ }
+
if (startLocator(locator, MAX_WAIT_TIME)) {
System.out.println(String.format("locator running on %s[%s]", locator.getConfig().getHost(),
locator.getConfig().getPort()));

0 comments on commit d69afff

Please sign in to comment.