This repository has been archived by the owner on Jul 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ebenfield/INTSCALA-41-v4.0
Intscala 41 v4.0
- Loading branch information
Showing
18 changed files
with
891 additions
and
269 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
rootProject.name = 'spring-integration-dsl-scala' | ||
|
||
include 'spring-integration-dsl-scala-core' | ||
include 'spring-integration-dsl-scala-http' | ||
include 'spring-integration-dsl-scala-jms' | ||
include 'spring-integration-dsl-scala-gemfire' | ||
include 'spring-integration-dsl-scala-file' | ||
include 'spring-integration-dsl-scala-ftp' | ||
include 'spring-integration-dsl-scala-sftp' | ||
rootProject.name = 'spring-integration-dsl-scala' | ||
|
||
include 'spring-integration-dsl-scala-core' | ||
include 'spring-integration-dsl-scala-http' | ||
include 'spring-integration-dsl-scala-jms' | ||
include 'spring-integration-dsl-scala-gemfire' | ||
include 'spring-integration-dsl-scala-file' | ||
include 'spring-integration-dsl-scala-jdbc' | ||
include 'spring-integration-dsl-scala-ftp' | ||
include 'spring-integration-dsl-scala-sftp' | ||
include 'spring-integration-dsl-scala-integration-demos' |
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
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
19 changes: 19 additions & 0 deletions
19
spring-integration-dsl-scala-core/src/test/resources/parent-config.xml
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,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation=" | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> | ||
|
||
<!-- <bean id="simpleService" class="org.springframework.integration.dsl.SimpleService"/>--> | ||
|
||
<!--<bean id="messageFlow" | ||
class="org.springframework.integration.dsl.messageFlowFactory" | ||
factory-method="createFlow"> | ||
</bean>--> | ||
|
||
<bean id="messageFlow" | ||
class="org.springframework.integration.dsl.scalaDslFlowFactory" | ||
factory-method="createFlow"> | ||
</bean> | ||
|
||
</beans> |
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
39 changes: 39 additions & 0 deletions
39
...l-scala-core/src/test/scala/org/springframework/integration/dsl/ScalaDslFlowFactory.scala
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,39 @@ | ||
/* | ||
* Copyright 2002-2012 the original author or authors. | ||
* | ||
* 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.springframework.integration.dsl | ||
|
||
|
||
/** | ||
* @author Ewan Benfield | ||
*/ | ||
object scalaDslFlowFactory { | ||
|
||
def createFlow(): BaseIntegrationComposition = { | ||
|
||
val messageFlow = | ||
filter { | ||
payload: String => payload == "World" | ||
} --> | ||
transform { | ||
payload: String => "Hello " + payload | ||
} --> | ||
handle { | ||
payload: String => println(payload) | ||
} | ||
|
||
messageFlow | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
...tegration-dsl-scala-jdbc/src/main/scala/org/springframework/integration/dsl/JdbcDsl.scala
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,90 @@ | ||
/* | ||
* Copyright 2002-2012 the original author or authors. | ||
* | ||
* 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.springframework.integration.dsl | ||
import java.util.concurrent.Executor | ||
import javax.sql.DataSource | ||
|
||
/** | ||
* @author Ewan Benfield | ||
*/ | ||
|
||
|
||
private[dsl] object JdbcDsl { | ||
val jdbcSchema = " http://www.springframework.org/schema/integration/jdbc " + | ||
"http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd" | ||
|
||
} | ||
|
||
//TODO Decide on appropriate API here | ||
object jdbc { | ||
def poll(dataSource: DataSource) = new { | ||
|
||
def atFixedRate(query: String, rate: Int): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedRate = rate) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target = query, poller = poller, dataSource = dataSource)) { | ||
|
||
def withMaxMessagesPerPoll(maxMessagesPerPoll: Int): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedRate = rate, maxMessagesPerPoll = maxMessagesPerPoll) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target = query, poller = poller, dataSource = dataSource)) { | ||
|
||
def withTaskExecutor(taskExecutor: Executor): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedRate = rate, maxMessagesPerPoll = maxMessagesPerPoll, taskExecutor = taskExecutor) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target = query, poller = poller, dataSource = dataSource)) | ||
} | ||
} | ||
} | ||
|
||
def withTaskExecutor(taskExecutor: Executor): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedRate = rate, taskExecutor = taskExecutor) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target = query, poller = poller, dataSource = dataSource)) | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
def withFixedDelay(query: String, delay: Int) = { | ||
val poller = new Poller(fixedDelay = delay) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target= query, poller = poller, dataSource = dataSource)) { | ||
|
||
def withMaxMessagesPerPoll(maxMessagesPerPoll: Int): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedDelay = delay, maxMessagesPerPoll = maxMessagesPerPoll) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target= query, poller = poller, dataSource = dataSource)) { | ||
|
||
def withTaskExecutor(taskExecutor: Executor): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedDelay = delay, maxMessagesPerPoll = maxMessagesPerPoll, taskExecutor = taskExecutor) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target= query, poller = poller, dataSource = dataSource)) | ||
} | ||
} | ||
} | ||
|
||
def withTaskExecutor(taskExecutor: Executor): ListeningIntegrationComposition = { | ||
val poller = new Poller(fixedDelay = delay, taskExecutor = taskExecutor) | ||
new ListeningIntegrationComposition(null, new JdbcInboundAdapterConfig(target= query, poller = poller, dataSource = dataSource)) | ||
} | ||
|
||
} | ||
|
||
} | ||
} | ||
|
||
def store(query:String, dataSource: DataSource) = | ||
new SendingEndpointComposition(null, new JdbcOutboundAdapterConfig(target = query, oneway = true, dataSource = dataSource)) { | ||
|
||
/*def asFileName(fileNameGenerationFunction: _ => String) = | ||
new SendingEndpointComposition(null, new JdbcOutboundGatewayConfig(target = query, dataSource = dataSource))*/ | ||
} | ||
} |
Oops, something went wrong.