Skip to content

Commit

Permalink
refactor: deprecate obsolete classes (#222)
Browse files Browse the repository at this point in the history
Refs: #211
  • Loading branch information
cjmamo authored Aug 15, 2024
1 parent fab5297 commit 47dbb11
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
10 changes: 7 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ The above configuration shows routing using the `+beanId+` attribute. It is also

== Apache Camel Integration

Integrating Smooks from Apache Camel lets you to access all the features of Smooks from within Camel. You can take an existing Smooks configuration and use this in your Camel routes using one of the options that are described in this chapter.
Integrating Smooks from Apache Camel lets you access all the features of Smooks from within Camel. You can take an existing Smooks configuration and use this in your Camel routes using one of the options that are described in this chapter.

Using Smooks in Camel can be done in three ways:

=== SmooksComponent

WARNING: SmooksComponent is deprecated and superseded by the https://camel.apache.org/components/next/smooks-component.html[Camel Smooks Component].

The `+SmooksComponent+` is a Camel https://camel.apache.org/component.html[Component] which can used when you want to process the Camel Message Body using Smooks. You can do this by adding a route in your Camel route configuration:

[source,java]
Expand Down Expand Up @@ -82,7 +84,9 @@ from("direct:unmarshal")

=== SmooksProcessor

Using `+SmooksProcessor+` gives you full control over Smooks, for example if you want to programatically create the underlying Smooks instance you’d use `+SmooksProcessor+`. When using `+SmooksProcessor+`, you can pass a Smooks instance to its constructor and prior to that programmatically configure Smooks.
WARNING: SmooksProcessor is deprecated and superseded by the https://camel.apache.org/components/next/smooks-component.html[Camel Smooks Component].

Using `+SmooksProcessor+` gives you full control over Smooks, for example if you want to programmatically create the underlying Smooks instance you’d use `+SmooksProcessor+`. When using `+SmooksProcessor+`, you can pass a Smooks instance to its constructor and prior to that programmatically configure Smooks.

Below is an example of using the `+SmooksProcessor+` in a Camel route:

Expand Down Expand Up @@ -112,7 +116,7 @@ from("file://input?noop=true")
.to("mock:result");
----

TIP: See the https://github.com/smooks/smooks-examples/tree/v1.0.5/camel[Apache Camel examples] in the examples page.
TIP: See the https://github.com/smooks/smooks-examples/tree/v2/camel[Apache Camel examples] in the examples page.

== Maven Coordinates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* @author Christian Mueller
* @author Daniel Bevenius
*/
@Deprecated(forRemoval = true, since = "2.0.0-RC5")
public class SmooksComponent extends DefaultComponent {
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
SmooksProcessor smooksProcessor = new SmooksProcessor(remaining, getCamelContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,26 @@
*
* @author Daniel Bevenius
*/
@Deprecated(forRemoval = true, since = "2.0.0-RC5")
public class SmooksEndpoint extends ProcessorEndpoint implements Service {
private final SmooksProcessor smooksProcesor;
private final SmooksProcessor smooksProcessor;

public SmooksEndpoint(String endpointUri, Component component, SmooksProcessor processor) {
super(endpointUri, component, processor);
this.smooksProcesor = processor;
this.smooksProcessor = processor;
}

public void start() {
try {
smooksProcesor.start();
smooksProcessor.start();
} catch (Exception e) {
throw new SmooksException(e.getMessage(), e);
}
}

public void stop() {
try {
smooksProcesor.stop();
smooksProcessor.stop();
} catch (Exception e) {
throw new SmooksException(e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* @author Daniel Bevenius
*/
@Converter(generateLoader = true)
@Deprecated(forRemoval = true, since = "2.0.0-RC5")
public class ResultConverter {
public static final String SMOOKS_RESULT_KEY = "SmooksResultKeys";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* @author Daniel Bevenius
*/
@Converter(generateLoader = true)
@Deprecated(forRemoval = true, since = "2.0.0-RC5")
public class SourceConverter {
private SourceConverter() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
* @author Christian Mueller
* @author Daniel Bevenius
*/
@Deprecated(forRemoval = true, since = "2.0.0-RC5")
public class SmooksProcessor implements Processor, Service, CamelContextAware {
public static final String SMOOKS_EXECUTION_CONTEXT = "CamelSmooksExecutionContext";
public static final String CAMEL_CHARACTER_ENCODING = "CamelCharsetName";
Expand Down

0 comments on commit 47dbb11

Please sign in to comment.