Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INT-4009: Support Composite Handler in Graph
JIRA: https://jira.spring.io/browse/INT-4009 Adds: ... "handlers" : [ { "name" : "polledChain$child#0", "type" : "transformer" }, { "name" : "polledChain$child#1", "type" : "service-activator" } ], ... to a chain node. INT-4010: Add Discard Flows to Object Model JIRA: https://jira.spring.io/browse/INT-4010
- Loading branch information
1 parent
590398f
commit 6a9a425
Showing
12 changed files
with
402 additions
and
32 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
38 changes: 38 additions & 0 deletions
38
...n-core/src/main/java/org/springframework/integration/handler/CompositeMessageHandler.java
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,38 @@ | ||
/* | ||
* Copyright 2016 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.handler; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.messaging.MessageHandler; | ||
|
||
/** | ||
* Classes implementing this interface delegate to a list of handlers. | ||
* | ||
* @author Gary Russell | ||
* @since 4.3 | ||
* | ||
*/ | ||
public interface CompositeMessageHandler extends MessageHandler { | ||
|
||
/** | ||
* Return an unmodifiable list of handlers. | ||
* @return the handlers. | ||
*/ | ||
List<MessageHandler> getHandlers(); | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...-core/src/main/java/org/springframework/integration/handler/DiscardingMessageHandler.java
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,37 @@ | ||
/* | ||
* Copyright 2016 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.handler; | ||
|
||
import org.springframework.messaging.MessageChannel; | ||
import org.springframework.messaging.MessageHandler; | ||
|
||
/** | ||
* Classes implementing this interface are capable of discarding messages. | ||
* | ||
* @author Gary Russell | ||
* @since 4.3 | ||
* | ||
*/ | ||
public interface DiscardingMessageHandler extends MessageHandler { | ||
|
||
/** | ||
* Return the discard channel. | ||
* @return the channel. | ||
*/ | ||
MessageChannel getDiscardChannel(); | ||
|
||
} |
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
66 changes: 66 additions & 0 deletions
66
...org/springframework/integration/support/management/graph/CompositeMessageHandlerNode.java
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,66 @@ | ||
/* | ||
* Copyright 2016 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.support.management.graph; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.springframework.messaging.MessageHandler; | ||
|
||
/** | ||
* Represents a composite message handler. | ||
* | ||
* @author Gary Russell | ||
* @since 4.3 | ||
* | ||
*/ | ||
public class CompositeMessageHandlerNode extends MessageHandlerNode { | ||
|
||
private final List<InnerHandler> handlers = new ArrayList<InnerHandler>(); | ||
|
||
public CompositeMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input, String output, | ||
List<InnerHandler> handlers) { | ||
super(nodeId, name, handler, input, output); | ||
this.handlers.addAll(handlers); | ||
} | ||
|
||
public List<InnerHandler> getHandlers() { | ||
return this.handlers; | ||
} | ||
|
||
public static class InnerHandler { | ||
|
||
private final String name; | ||
|
||
private final String type; | ||
|
||
public InnerHandler(String name, String type) { | ||
this.name = name; | ||
this.type = type; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
public String getType() { | ||
return this.type; | ||
} | ||
|
||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...rg/springframework/integration/support/management/graph/DiscardingMessageHandlerNode.java
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,42 @@ | ||
/* | ||
* Copyright 2016 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.support.management.graph; | ||
|
||
import org.springframework.messaging.MessageHandler; | ||
|
||
/** | ||
* Represents an endpoint that has a discard channel. | ||
* | ||
* @author Gary Russell | ||
* @since 4.3 | ||
* | ||
*/ | ||
public class DiscardingMessageHandlerNode extends MessageHandlerNode { | ||
|
||
private final String discards; | ||
|
||
public DiscardingMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input, String output, | ||
String discards) { | ||
super(nodeId, name, handler, input, output); | ||
this.discards = discards; | ||
} | ||
|
||
public String getDiscards() { | ||
return this.discards; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
...amework/integration/support/management/graph/ErrorCapableCompositeMessageHandlerNode.java
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,46 @@ | ||
/* | ||
* Copyright 2016 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.support.management.graph; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.integration.handler.CompositeMessageHandler; | ||
|
||
/** | ||
* Represents a composite message handler that can emit error messages | ||
* (pollable endpoint). | ||
* | ||
* @author Gary Russell | ||
* @since 4.3 | ||
* | ||
*/ | ||
public class ErrorCapableCompositeMessageHandlerNode extends CompositeMessageHandlerNode implements ErrorCapableNode { | ||
|
||
private final String errors; | ||
|
||
public ErrorCapableCompositeMessageHandlerNode(int nodeId, String name, CompositeMessageHandler handler, String input, | ||
String output, String errors, List<InnerHandler> handlers) { | ||
super(nodeId, name, handler, input, output, handlers); | ||
this.errors = errors; | ||
} | ||
|
||
@Override | ||
public String getErrors() { | ||
return this.errors; | ||
} | ||
|
||
} |
Oops, something went wrong.