ProcessorWrapper.java
1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.rewriter.ProcessingContext
* org.apache.sling.rewriter.Processor
* org.apache.sling.rewriter.ProcessorConfiguration
* org.osgi.service.component.ComponentInstance
*/
package com.day.cq.rewriter.processor.impl;
import com.day.cq.rewriter.processor.ProcessingContext;
import com.day.cq.rewriter.processor.Processor;
import com.day.cq.rewriter.processor.ProcessorConfiguration;
import com.day.cq.rewriter.processor.impl.ProcessingContextWrapper;
import com.day.cq.rewriter.processor.impl.ProcessorConfigurationWrapper;
import java.io.IOException;
import java.io.PrintWriter;
import org.osgi.service.component.ComponentInstance;
import org.xml.sax.ContentHandler;
public class ProcessorWrapper
implements org.apache.sling.rewriter.Processor {
private final Processor delegatee;
private final ComponentInstance instance;
public ProcessorWrapper(Processor t, ComponentInstance cI) {
this.delegatee = t;
this.instance = cI;
}
public void finished(boolean errorOccured) throws IOException {
IOException exception = null;
try {
this.delegatee.finished();
}
catch (IOException ioe) {
exception = ioe;
}
this.instance.dispose();
if (exception != null) {
throw exception;
}
}
public ContentHandler getContentHandler() {
return this.delegatee.getContentHandler();
}
public PrintWriter getWriter() {
return this.delegatee.getWriter();
}
public void init(org.apache.sling.rewriter.ProcessingContext context, org.apache.sling.rewriter.ProcessorConfiguration config) throws IOException {
this.delegatee.init(new ProcessingContextWrapper(context), new ProcessorConfigurationWrapper(config));
}
public String toString() {
return this.delegatee.toString();
}
}