Skip to content

Commit

Permalink
重构部分方法名
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zhou committed Nov 4, 2012
1 parent 7903941 commit 7c9a84e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.alibaba.citrus.service.pipeline.PipelineContext;
import com.alibaba.citrus.service.pipeline.support.AbstractValveDefinitionParser;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInOutValve;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInputOutputValve;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
Expand All @@ -32,9 +32,9 @@
*
* @author Michael Zhou
*/
public class DoPerformRunnableValve extends AbstractInOutValve {
public class DoPerformRunnableValve extends AbstractInputOutputValve {
@Override
protected String getInDefault() {
protected String getDefaultInputKey() {
return PerformRunnableAsyncValve.ASYNC_CALLBACK_KEY;
}

Expand All @@ -55,7 +55,7 @@ public void invoke(PipelineContext pipelineContext) throws Exception {
public static class DefinitionParser extends AbstractValveDefinitionParser<DoPerformRunnableValve> {
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
attributesToProperties(element, builder, "out");
attributesToProperties(element, builder, "output");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import com.alibaba.citrus.service.pipeline.support.AbstractValveDefinitionParser;
import com.alibaba.citrus.service.requestcontext.RequestContext;
import com.alibaba.citrus.service.requestcontext.RequestContextChainingService;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInOutValve;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInputOutputValve;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -54,7 +54,7 @@
*
* @author Michael Zhou
*/
public class PerformRunnableAsyncValve extends AbstractInOutValve {
public class PerformRunnableAsyncValve extends AbstractInputOutputValve {
final static String ASYNC_CALLBACK_KEY = "_async_callback_";
private final static Logger log = LoggerFactory.getLogger(PerformRunnableAsyncValve.class);
private long defaultTimeout = 0L;
Expand Down Expand Up @@ -104,7 +104,7 @@ public void setAsyncPipeline(Pipeline asyncPipeline) {
}

@Override
protected String getOutDefault() {
protected String getDefaultOutputKey() {
return ASYNC_CALLBACK_KEY;
}

Expand Down Expand Up @@ -214,7 +214,7 @@ public void onStartAsync(AsyncEvent event) throws IOException {
public static class DefinitionParser extends AbstractValveDefinitionParser<PerformRunnableAsyncValve> {
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
attributesToProperties(element, builder, "in", "defaultTimeout", "defaultCancelingTimeout");
attributesToProperties(element, builder, "input", "defaultTimeout", "defaultCancelingTimeout");

// sub pipeline
Object asyncPipeline = parsePipeline(element, null, parserContext, null, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</xsd:element>

<xsd:complexType name="DoPerformRunnableValveType">
<xsd:attribute name="out" type="xsd:string" default="result" />
<xsd:attribute name="output" type="xsd:string" default="result" />
</xsd:complexType>

</xsd:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsd:any namespace="http://www.alibaba.com/schema/services/pipeline/valves"
minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="in" type="xsd:string" default="result" />
<xsd:attribute name="input" type="xsd:string" default="result" />
<xsd:attribute name="defaultTimeout" type="xsd:long" default="0" />
<xsd:attribute name="defaultCancelingTimeout" type="xsd:long" default="1000" />
<xsd:attribute name="executor-ref" type="xsd:string" use="optional" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<services:pipeline id="pipeline3">
<valves:performRunnableAsync>
<valves:setLoggingContext />
<valves:doPerformRunnable out="myresult" />
<valves:doPerformRunnable output="myresult" />
</valves:performRunnableAsync>
</services:pipeline>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</services:pipeline>

<services:pipeline id="pipeline6">
<valves:performRunnableAsync in="myresult" />
<valves:performRunnableAsync input="myresult" />
</services:pipeline>

<services:pipeline id="pipeline7">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ public void subPipelineNotSpecified() {
performRunnableAsyncValve = getValve("pipeline1", 0, PerformRunnableAsyncValve.class);
valve = getDoPerformRunnableValve(0);

assertEquals("result", valve.getOut());
assertEquals("result", valve.getOutputKey());
}

@Test
public void resultNameNotSpecified() {
performRunnableAsyncValve = getValve("pipeline2", 0, PerformRunnableAsyncValve.class);
valve = getDoPerformRunnableValve(1);

assertEquals("result", valve.getOut());
assertEquals("result", valve.getOutputKey());
}

@Test
public void resultNameSpecified() {
performRunnableAsyncValve = getValve("pipeline3", 0, PerformRunnableAsyncValve.class);
valve = getDoPerformRunnableValve(1);

assertEquals("myresult", valve.getOut());
assertEquals("myresult", valve.getOutputKey());
}

private DoPerformRunnableValve getDoPerformRunnableValve(int index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ public void cancelingTimeoutSpecified() {
@Test
public void resultNameNotSpecified() {
valve = getValve("pipeline1", 0, PerformRunnableAsyncValve.class);
assertEquals("result", valve.getIn());
assertEquals("result", valve.getInputKey());
}

@Test
public void resultNameSpecified() {
valve = getValve("pipeline6", 0, PerformRunnableAsyncValve.class);
assertEquals("myresult", valve.getIn());
assertEquals("myresult", valve.getInputKey());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package com.alibaba.citrus.async.support;

import com.alibaba.citrus.service.pipeline.PipelineContext;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInOutValve;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInputOutputValve;

public class GetScreenResult extends AbstractInOutValve {
public class GetScreenResult extends AbstractInputOutputValve {
private static Object result;

public static void clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package com.alibaba.citrus.async.support;

import com.alibaba.citrus.service.pipeline.PipelineContext;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInOutValve;
import com.alibaba.citrus.turbine.pipeline.valve.AbstractInputOutputValve;

public class SetScreenResult extends AbstractInOutValve {
public class SetScreenResult extends AbstractInputOutputValve {
private static final ThreadLocal<Object> resultHolder = new ThreadLocal<Object>();

public static void clear() {
Expand Down

0 comments on commit 7c9a84e

Please sign in to comment.