Showing posts with label languages. Show all posts
Showing posts with label languages. Show all posts

Wednesday, June 22, 2011

IDEs for the Polyglot Programmer on Windows

First off, I'm never going to pay for an IDE. It goes against my nature of being resourceful and cheap. Here is what I've found in the Open Source space. I am not talking about pure Java Enterprise development. (For that you should standardize on one of the big 3: eclipse/netbeans/intelliJ). This is for the person who enjoys playing in Ruby, Groovy, PHP, or your language of the day. On a Mac, I'm told the favorite is TextMate. But what should we use on Windows....???

IDE
1. Komodo Edit - very lightweight (50MB RAM). Ctrl+J for code completion. Add-ons are great and done like Firefox add-ons. No Groovy.
2. Aptana Studio - awesome Git integration. it's eclipse with better layout and color scheme. but it's a bit bulky (150MB RAM). No Groovy.

Just a Text Editor with Syntax Highlighting:
Notepad++

No
RubyMine - cool, but only 30-day trial is free.
SciTE Scintilla Based Text Editor - just a text editor. Notepad++ is better.

Read More »

Monday, June 13, 2011

Groovy JMX MBean Viewer instead of JConsole

You might be monitoring something with JConsole, and thinking, how can I automate this check?

Answer: With Groovy!

Here is an example of how easy it is to probe an ActiveMQ MBean that sits on 2 App Servers.

import javax.management.remote.*

['11.12.13.123', '11.12.13.124'].each { serverIp ->
   def server = jmxConnect(serverIp)
   def mbean = new GroovyMBean(server, 'org.apache.activemq:BrokerName=appEventBroker,Type=Queue,Destination=appEventQueue')
   println "On app server $serverIp"
   printQueueStatus(mbean)
}

def jmxConnect(serverIp) {
   def url = "service:jmx:rmi:///jndi/rmi://$serverIp:8999/jmxrmi"
   def env = [(JMXConnector.CREDENTIALS): (String[])['myRole', 'myPassword']]
   def connection = JMXConnectorFactory.connect(new JMXServiceURL(url), env)
   def server = connection.MBeanServerConnection
   return server
}

def printQueueStatus(mbean) {
   println "DequeueCount: $mbean.DequeueCount"
   println "EnqueueCount: $mbean.EnqueueCount"
}

Read More »

Monday, March 1, 2010

Jackrabbit JCR: Part 1 - Getting Started

Working at Quick Solutions, I have become an expert on the Java Content Repository. Many wish to stand-up a repository but reading through mounds of documentation is often too great a barrier. What if it were as simple as download and start? Well here you go!

Start the Repository
  1. Download jackrabbit-standalone. Unzip it.
  2. At a command prompt in the unzipped directory, type:
    > startRepo
Tools to Communicate with the Repository
  1. A Web browser. Browse to http://localhost:8123/
    Click "Browse" along the left menu.
  2. A WebDAV Client. Download AnyClient. (Freeware)

    Host: http://localhost:8123/repository/default/
    Username: admin
    Password: admin
    Connection type: WebDAV

  3. Command line. Download jcr-commands. (I can't take credit for this. License Info here.)
    At a command prompt in the unzipped bin directory, type:
    > run
    For this tool you must connect through RMI, not HTTP, so type:
    > connect rmi://localhost:1099/jackrabbit
    > login admin admin
    > ls
  4. Java Code. Download JcrTalker. Unzip it.
    At a command prompt in the unzipped directory, type (notice the trailing slash):
    > groovy JcrTalker.groovy /

(Note: The .bat files used above can easily be translated to shell scripts or Mac scripts to suit your non-windows needs.)
Read More »