Archive for the ‘OSS’ Category

CRaSH 1.0.0-beta9 release

Thursday, July 8th, 2010

CRaSh 1.0.0-beta9 minor feature and fix a few issues with GateIn 3.1:

  • export/import uses now the SSH username and password for accessing JCR for GateIn 3.1
  • connect now always require a password for GateIn 3.1
  • documentation now has a front cover page
enjoy!

Reflext improves its annotation introspection

Thursday, June 3rd, 2010

So far the annotation API in Reflext was using the runtime API to provide annotation access. What I call the runtime API is what most of developers are used to when dealing with annotations.

When using the java.lang.reflect runtime, this works perfectly as the runtime provides obviously runtime annotation. Nothing special here. However at compile time, this runtime access is emulated by the compiler. The real API to access an annotation is the java.lang.model.element.AnnotationMirror interface that is a totally detyped access to an annotation. But the APT tries to be nice and provides an emulation of runtime annotation that works well until

  • the introspected annotation is being compiled and it is not yet available under its class form
  • the annotation is already compiled (coming likely from JDK or a dependency) but it has a Class parameter and that class is being compiled. In that situation the Class object is not yet available, consequently it fails.

For that matter there is now in Reflext an API that provides a detyped access to an annotation that works equally with runtime and compile time implementations (runtime annotation access is still possible of course) .Using such API is obviously less intuitive than using the annotation directly but when you don’t have the guarantee that you are the annotation type is already compiled it’s the only way to go.

CRaSH 1.0.0 Beta 8 released

Thursday, May 27th, 2010

We have just released CRaSH 1.0.0 Beta 8 on Google Code forge, in that release we have worked on two usability aspects of the shell:

  • The capability for a command to prompt a value with or without echo of the value entered by the user. It is mainly used by the connect command to prompt the password when it is not entered via the -p option.
  • The second feature is the up/down arrow associated to recalling previously entered commands.
The prompt command implementation required a refactor of the CRaSH architecture, the main challenge coming from the following facts:
  • the shell is invoked by a term and the term has blocking IO
  • the execution of a command needs to be interruptible
The refactoring was quite fun to do, and lead to a few improvements in the architecture that consisted mostly in decoupling the various systems, now we can distinguish:
  1. The Shell that executes the commands and returns a result. The current implementation is connected to JCR to execute Groovy commands.
  2. The Shell Connector, a state machine executing commands in a synchronous or asynchronous manner, it depends on its configuration. The execution of a command can be cancelled.
  3. The Term: a state machine that translates IO into actions, managing also the command history.
  4. The TermIO: the input/output of the Term, that is implemented using Apache SSHD and Wimpi TelnetD
At the moment I am quite satisfied by the current features. I think it is still missing the command completion and I don’t have a clue if it is easy or complex to do and which system should manage it, I’ll leave it for later fun. Maybe it will be easy to do, or it could require some new important refactor to make it possible to happen, who knows?

CRaSH 1.0.0-beta1 release

Tuesday, December 22nd, 2009

I’m glad to announce the release of CRaSH 1.0.0-beta1!!!

But wait, what is CRaSH?

CRaSH is a shell for Java Content Repository that allows remote connection to a server and performs various operations such as browsing and interacting with the repository, executing queries, performing import/export operations. You can read a complete introduction here.

As a GateIn developer I often use the underlying JCR engine and I developed CRaSH as a companion for my development tasks.

The project is written in Java and Groovy and leverages a few good open source projects:

  • The command system is written in Groovy allowing seamless extension of the shell by adding new commands
  • Netty provides the remote connection capabilities
  • Args4j parses the command line and inject the option and argument in the Groovy commands

It comes as a war file that setup a telnet daemon on the port 5000.

The project is developed on Google Code under the LGPL license and contributions are welcome :-) !