Skip to content

Commit

Permalink
Add commands and README doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
cunningt committed Feb 15, 2014
1 parent 5788b37 commit 0d6d838
Show file tree
Hide file tree
Showing 43 changed files with 754 additions and 2,082 deletions.
124 changes: 80 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,83 @@ plugin-switchyard

SwitchYard Forge Plugin

# Switchyard Forge Clojure Component
This project provides an implementation of a Forge plugin capable of generating Clojure services in SwitchYard.
_ _ _

## Installing the Clojure Facet
Before you start make sure that you have the required plugins in your Forge classpath. This can be done by putting the jars in Forge's _lib_ directory or
putting them in _~/.forge/plugins_.

The Clojure plugin depend on the switchyard faced. The SwitchYard facet will update the current project and add files like _switchyard.xml_.
To see which facets are install you can run the following command:
> project list-facets

The facets that are green in this list are the ones that are installed on the current project.

### Installing the _switchyard_ facet
> project install-facet switchyard

### Installing the _switchyard.clojure_ facet
> project install-facet switchyard.clojure

_ _ _
## clojure-service create command
> help clojure-service create

[clojure-service create] - Create a new implemenation.clojure

[OPTIONS]
[--serviceName, -s] - The service name - The SwitchYard service name to use for this implementation
[--inlineScript, -i] - Use inline Clojure script - Path to the Clojure script to inline, the content will be placed into the script element
[--emptyInlineScript] - Creates an empty 'script' element - An empty 'script' element will be created that can be filled in later.
[--externalScriptPath, -e] - Path to the external Clojure Script - Path to the external Clojure script to be referenced from the 'scriptFile' attribute
[--emptyExternalScriptPath] - Creates an empty 'scriptFile' attribute - An empty 'scriptFile' attribute will be created that can be filled in later.
[--injectExchange, -x] - Inject the SwitchYard Exchange object into the Clojure script - The SwitchYard Exchange will be injected into the Clojure script if this value is set. If not, only the Message content will be injected.

### Creating with an _inline_ script
> clojure-service create --serviceName testing --inlineScript sample.clj --injectExchange

### Creating with an external script
> clojure-service create --scriptFile "/some/path/sample.clj"
_ _ _

## Enable stacktraces in Forge
set VERBOSE true
_ _ _/
SwitchYard integrates with JBoss Forge to provide a set of rapid application development tools for service-oriented applications.  Please consult the Getting Started guide for information on how to install Forge and the SwitchYard extensions to Forge.

h3. Creating a Project

The first thing you'll want to do with Forge is create a new project.  This can be done inside the Forge shell using the new-project command.

{code}
switchyard$ forge

_____
| ___|__ _ __ __ _ ___
| |_ / _ \| `__/ _` |/ _ \ \\
| _| (_) | | | (_| | __/ //
|_| \___/|_| \__, |\___|
|___/

JBoss Forge, version [ 2.0.0.Final ] - JBoss, by Red Hat, Inc. [ http://forge.jboss.org ]
[switchyard]$ project-new --named syApp --topLevelPackage org.switchyard.examples.forge
***SUCCESS*** Project named 'syApp' has been created.

{code}
At this point, you have an empty application with a few Maven facets installed.  What's a facet you ask?  Read on ....

h3. Facets

Facets add capabilities to an application and to the forge environment itself.  This allows SwitchYard to add dependencies to your application's pom based on the functionality you will be using, instead of sticking every possible SwitchYard dependency in the application by default.  Facets are also used to add commands specific to SwitchYard itself and components which you will be using in your application.  The following facets are currently available:
* *switchyard* \- core set of commands and dependencies for the SwitchYard runtime
* *switchyard.bean* \- commands and dependencies for Bean component services
* *switchyard.bpm* \- commands and dependencies for BPM component services
* *switchyard.rules* \- commands and dependencies for Rules component services
* *switchyard.soap* \- commands and dependencies for SOAP gateway bindings
* *switchyard.camel* \- commands and dependencies for Camel services and gateway bindings
* *switchyard.rest* \- commands and dependencies for RESTEasy gateway bindings
* *switchyard.http* \- commands and dependencies for HTTP gateway bindings

h3. Commands

The following SwitchYard commands are available in Forge (grouped by facet).

*{_}switchyard{_}*
* {{switchyard-show-confi{}}}g : displays the current state of your application's configuration, including services, references, and bindings.
* {{switchyard-promote-service}} : promotes an internal application-scoped service to be visible to other applications.
* s{{{}witchyard-promote-reference}} : promotes an internal application-scoped reference so that it can be mapped to services provided in other applications.
* s{{{}witchyard-create-service-test}} : create a new unit test for a service.
* s{{{}witchyard-get-version}} : returns the version of SwitchYard used by the application.
* s{{{}witchyard-trace-messages}} : enables message tracing at runtime - all messages will be logged.
* s{{{}witchyard-import-artifacts}} : add a dependency on a service artifact module to the application's configuration
* s{{{}witchyard-add-operation-selector}} : add an operation selector to a service binding.
* s{{{}witchyard-add-policy}} : add a required policy on a component service or reference.
* s{{{}witchyard-add-reference}} : adds a reference to a service implementation; particularly useful for service types which do not autogenerate references (Camel, BPM, BPEL).
* s{{{}witchyard-add-transformer}} : adds a Transformer from one message format to another.
* s{{{}witchyard-add-validator}} : adds a message validator to a service implementation.

*{_}switchyard-bean{_}*
* {{switchyard-bean-service-create}} : creates a new CDI Bean service, consisting of a service interface and implementation class.
* {{switchyard-bean-reference-create}} : creates a new CDI Bean reference.

*{_}switchyard-bpm{_}*
* {{switchyard-bpm-service-create}} : creates a new BPM service, consisting of a service interface and implementation class.

*{_}switchyard-rules{_}*
* {{switchyard-rules-service create}} : creates a new Rules service, consisting of a service interface and implementation class.

*{_}switchyard-camel{_}*
* {{switchayrd-camel-service-create}} : creates a new XML or Java DSL Camel route.
* {{switchyard-camel-bind-service}} : binds a service using a Camel endpoint URI.
* {{switchyard-camel-bind-reference}} : binds a reference using a Camel endpoint URI.

*{_}switchyard-soap{_}*
* {{switchyard-soap-bind-service}} : binds a service to a SOAP endpoint.
* {{switchyard-soap-bind-reference}} : binds a reference to a SOAP endpoint.

*{_}switchyard-rest{_}*
* {{switchyard-rest-bind-service}} : binds a service to a RESTEasy endpoint.
* {{switchyard-rest-bind-reference}} : binds a reference to a RESTEasy endpoint.

*{_}switchyard-http{_}*
* {{switchyard-http-bind-service}} : binds a service to a HTTP endpoint.
* {{switchyard-http-bind-reference}} : binds a reference to a HTTP endpoint.

69 changes: 68 additions & 1 deletion addon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@
</exclusion>
</exclusions>
</dependency>

<!-- BPM dependencies -->
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-bpm</artifactId>
<version>${switchyard.version}</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Expand Down Expand Up @@ -331,6 +337,49 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-resteasy</artifactId>
<version>${switchyard.version}</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-netty</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jdk-http</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.littleshoot</groupId>
<artifactId>littleproxy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-rules</artifactId>
Expand Down Expand Up @@ -424,6 +473,10 @@
<artifactId>switchyard-component-http</artifactId>
<version>${switchyard.version}</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -580,7 +633,19 @@
<artifactId>serializer</artifactId>
<version>${version.xalan}</version>
</dependency>

<dependency>
<groupId>org.jboss.aesh</groupId>
<artifactId>aesh</artifactId>
<version>0.48</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>shell</artifactId>
<classifier>forge-addon</classifier>
<version>${forge.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<repositories>
Expand All @@ -594,6 +659,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
Expand All @@ -603,6 +669,7 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>create-forge-addon</id>
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0d6d838

Please sign in to comment.