Skip to content

Commit

Permalink
Bumped version to 0.4, small readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kimble committed Nov 28, 2010
1 parent 07b0e85 commit fc12737
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion HawkEventingGrailsPlugin.groovy
Expand Up @@ -14,7 +14,7 @@ import org.codehaus.groovy.grails.plugins.GrailsPlugin

class HawkEventingGrailsPlugin {

def version = "0.3"
def version = "0.4"

def grailsVersion = "1.3.0 > *"
def dependsOn = [:]
Expand Down
18 changes: 11 additions & 7 deletions README.md
Expand Up @@ -20,7 +20,7 @@ Subscribing to events
void afterPropertiesSet() {
eventBroker.subscribe("hibernate.book") { Event event ->
// Do something with book
// Do something with book (event.payload)
}
}
Expand All @@ -32,8 +32,8 @@ Subscribing to events

consumers = {

hibernate.book.created { Book book ->
// Do something with book
hibernate.book.created { Event event ->
// Do something with book (event.payload)
}
}
Expand All @@ -42,8 +42,8 @@ Subscribing to events

def doWithEvents = { ApplicationContext ctx ->

hibernate.book.created { Book book ->
// Do something with book
hibernate.book.created { Event event ->
// Do something with event.payload
}
}
Expand Down Expand Up @@ -86,6 +86,11 @@ Events published to `hibernate.book.created` will also be published to `hibernat
Changelog
----------

### v0.4 - November the 28th. 2010

* Started working (not completed) on support for async event publishing if the [Grails Executor](http://grails.org/plugin/executor) plugin is installed (no compile time dependency).
* Breaking: Refactored package structure to reflect the new name

### v0.3 - November the 6th. 2010

* Feature: Support for declaring methods as event consumers using a @Consuming annotation.
Expand All @@ -101,5 +106,4 @@ Consumers in need of the broker should have it injected by Spring.
Roadmap
--------

* Support for async events using the [Grails Executor](http://grails.org/plugin/executor) plugin?
* More testing and a few code refactorings.
The plugin is pretty much feature ready, but more tests, examples and documentation would be nice.
11 changes: 5 additions & 6 deletions grails-app/conf/BuildConfig.groovy
Expand Up @@ -16,11 +16,10 @@ grails.project.dependency.resolution = {
grailsHome()
grailsCentral()

// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
//mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
mavenLocal()
mavenCentral()

//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
Expand All @@ -29,6 +28,6 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

// runtime 'mysql:mysql-connector-java:5.1.5'
}

}
@@ -1,6 +1,8 @@
package grails.plugins.hawkeventing.config

import grails.plugins.hawkeventing.*
import grails.plugins.hawkeventing.EventBroker;
import grails.plugins.hawkeventing.EventSubscription;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.groovy.grails.commons.GrailsApplication;
Expand All @@ -25,11 +27,11 @@ class OtherPluginsConfigurationReader implements InitializingBean {
GrailsPluginManager pluginManager

void afterPropertiesSet() {
log.info "Reading event configuration from installed plugins"
log.debug "Reading event configuration from installed plugins"
pluginManager.allPlugins.each { GrailsPlugin plugin ->
def pluginPropeties = plugin.instance.properties
if (pluginPropeties.containsKey("doWithEvents")) {
log.info "Found event configuration in " + plugin.getName()
log.debug "Found event configuration in " + plugin.getName()
Closure configClosure = pluginPropeties.get(EVENT_CLOSURE_PROPERTY_NAME)
Set<EventSubscription> subscriptions = ClosureSubscriptionFactory.fromClosure(configClosure).getSubscriptions();
eventBroker.subscribe(subscriptions);
Expand Down
6 changes: 4 additions & 2 deletions src/java/grails/plugins/hawkeventing/EventBroker.java
Expand Up @@ -64,8 +64,10 @@ public Set<Future<?>> publishEvent(Event event) {
while (eventNameDecoder.hasNext()) {
String currentEventName = eventNameDecoder.next();
Set<EventConsumer> consumers = getEventConsumers(currentEventName);
for (EventConsumer consumer : consumers)
publisher.publish(event, consumer);
for (EventConsumer consumer : consumers) {
Future<?> future = publisher.publish(event, consumer);
futures.add(future);
}
}

return futures;
Expand Down
@@ -1,10 +1,10 @@
package grails.plugins.hawkeventing

import grails.plugins.hawkeventing.BaseEvent;
import grails.plugins.hawkeventing.exceptions.EventException;
import grails.plugin.spock.IntegrationSpec;
import grails.plugin.spock.UnitSpec
import grails.plugins.hawkeventing.BaseEvent
import grails.plugins.hawkeventing.exceptions.EventException

class AsyncEventPublisherSpec extends IntegrationSpec {
class AsyncEventPublisherSpec extends UnitSpec {

def syncEvent = new BaseEvent("hibernate.newSession", null, false)
def publisher = new AsyncEventPublisher()
Expand All @@ -19,5 +19,5 @@ class AsyncEventPublisherSpec extends IntegrationSpec {
when: publisher.publish syncEvent, null
then: thrown(EventException)
}

}

0 comments on commit fc12737

Please sign in to comment.