This file contains hidden or 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
| /** | |
| * Creates a new JMS Message proxy | |
| * @param message The JMS message | |
| * @param connection The session used to create the browser | |
| * @param destination The destination the browser is browsing | |
| * @throws JMSException | |
| */ | |
| public ClosuredJMSMessage(Message message, Session session, Destination destination) throws JMSException { | |
| this.message = message; | |
| this.destination = destination; |
This file contains hidden or 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
| #!/bin/bash | |
| ####################################### | |
| # Graphite Install | |
| # Run with sudo for best results | |
| # | |
| ####################################### | |
| if [[ "$(/usr/bin/whoami)" != "root" ]]; then | |
| echo "This script must be run as root or using sudo.Script aborted." | |
| exit 1 |
This file contains hidden or 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
| import com.onexchange.org.*; | |
| import groovy.xml.MarkupBuilder; | |
| writer = new StringWriter() | |
| fixml = new MarkupBuilder(writer); | |
| reqIdCounter = 0; | |
| transactionType = 3; | |
| adjType = 2; | |
| actn = 1; | |
| bizDt = "2011-04-28"; |
This file contains hidden or 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
| import groovy.xml.MarkupBuilder; | |
| writer = new StringWriter() | |
| fixml = new MarkupBuilder(writer); | |
| fixml.setDoubleQuotes(true); | |
| driverSql = "select * from ......."; |
This file contains hidden or 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
| import org.helios.gmx.*; | |
| gmx = Gmx.remote("service:jmx:rmi://testserver1:8002/jndi/rmi://testserver1:8003/jmxrmi"); | |
| gmx.mbeans("java.lang:type=MemoryPool,name=*", { | |
| println "${it.objectName}:\t${it.Usage.committed}"; | |
| }); |
This file contains hidden or 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
| import org.helios.gmx.*; | |
| Gmx.attachInstances(true, { | |
| println it.mbean("JMImplementation:type=MBeanServerDelegate").MBeanServerId; | |
| }); |
This file contains hidden or 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
| import org.helios.gmx.*; | |
| def gmx = Gmx.remote("service:jmx:rmi://testserver1:8002/jndi/rmi://testserver1:8003/jmxrmi"); | |
| gmx.installRemote(); | |
| def remoteMBeanServer = gmx.gmxRemote(); | |
| def script = | |
| "import java.lang.management.*; long blockedCount = 0; " + | |
| "ManagementFactory.getThreadMXBean().getThreadInfo(ManagementFactory.getThreadMXBean().getAllThreadIds()).each() { " + | |
| "blockedCount += it.getBlockedCount(); }; " + | |
| "return blockedCount; "; | |
| long totalBc = remoteMBeanServer.invokeScript(script, [] as Object[]); |
This file contains hidden or 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
| def gmx = Gmx.remote("service:jmx:rmi://testserver1:8002/jndi/rmi://testserver1:8003/jmxrmi"); | |
| gmx.exec({ | |
| println "Hello Jupiter"; | |
| }); |
This file contains hidden or 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
| import org.codehaus.groovy.control.* | |
| // Compile a closure producing class | |
| cu = new CompilationUnit(); | |
| cu.addSource("ClosureFactory.groovy", "public class ClosureFactory { public Closure getClosure() { return {message -> println message} }; }"); | |
| cu.compile(); | |
| // Get the closure, the closure class bytes and invoke the closure. | |
| clazz = Class.forName("ClosureFactory"); | |
| clozure = clazz.newInstance().getClosure(); | |
| clozureClass = clozure.getClass(); |
This file contains hidden or 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
| import org.helios.gmx.classloading.*; | |
| foo = {message -> println message}; | |
| bytes = ByteCodeRepository.getInstance().getByteCode(foo.getClass()); | |
| println "Class:${foo.getClass().getName()} ByteCode:${bytes.length} bytes"; |
OlderNewer