Created
December 23, 2013 10:39
-
-
Save emag/8094870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.ConfigurableApplicationContext; | |
import org.springframework.util.FileSystemUtils; | |
import java.io.File; | |
public class Receiver { | |
/** | |
* Get a copy of the application context | |
*/ | |
@Autowired | |
ConfigurableApplicationContext context; | |
/** | |
* When you receive a message, print it out, then shut down the application. | |
* Finally, clean up any ActiveMQ server stuff. | |
* @param message | |
*/ | |
public void receiveMessage(String message) { | |
System.out.println("Received <" + message + ">"); | |
context.close(); | |
FileSystemUtils.deleteRecursively(new File("activemq-data")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment