Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merged Events back in to core. NO MORE CHANGING OUR MINDS OK!
- Loading branch information
1 parent
b422589
commit fecd749
Showing
39 changed files
with
2,366 additions
and
266 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
61 changes: 61 additions & 0 deletions
61
grails-app/services/org/grails/plugin/platform/test/SampleService.groovy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* Copyright 2011-2012 the original author or authors: | ||
* | ||
* Marc Palmer (marc@grailsrocks.com) | ||
* Stéphane Maldini (stephane.maldini@gmail.com) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.grails.plugin.platform.test | ||
|
||
import org.grails.plugin.platform.events.Listener | ||
/** | ||
* @file | ||
* @author Stephane Maldini <smaldini@doc4web.com> | ||
* @version 1.0 | ||
* @date 02/01/12 | ||
* @section DESCRIPTION | ||
* | ||
* [Does stuff] | ||
*/ | ||
class SampleService { | ||
|
||
static transactional = true | ||
|
||
static events = { | ||
testEvent when: { | ||
it.source == 'plugin-platform' | ||
} | ||
} | ||
|
||
@Listener('sampleHello') | ||
void testEvent(test) { | ||
println "Hello $test" | ||
} | ||
|
||
@Listener | ||
void beforeInsert(Book book) { | ||
println "will insert $book.title" | ||
} | ||
|
||
@Listener | ||
void afterLoad(Author author) { | ||
println "will load $author.name" | ||
} | ||
|
||
@Listener('sampleHello') | ||
def testEvent3(test) { | ||
println "Hello (bis) - $test" | ||
true | ||
} | ||
} |
This file contains 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
Oops, something went wrong.