Skip to content

Instantly share code, notes, and snippets.

@justinedelson
Created February 21, 2013 20:22
Show Gist options
  • Save justinedelson/5007868 to your computer and use it in GitHub Desktop.
Save justinedelson/5007868 to your computer and use it in GitHub Desktop.
Groovy script to unquiesce a CQ/CRX instance
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnectorFactory;
import javax.management.ObjectName;
// assuming that CQ is started with -Dcom.sun.management.jmxremote.port=9000
def jmxUrl = "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi";
def serviceUrl = new JMXServiceURL(jmxUrl);
def jmxConnector = JMXConnectorFactory.connect(serviceUrl);
def mbeanConn = jmxConnector.getMBeanServerConnection();
def repositoryName = new ObjectName("com.adobe.granite:type=Repository");
mbeanConn.invoke(repositoryName, "unblockRepositoryWrites", new Object[0], new String[0]);
System.out.println("The System is now unquiesced.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment