01: /*
02: * $Id: DiscoverableTransformer.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10: package org.mule.api.transformer;
11:
12: /**
13: * A interface to denote that a transformer is discoverable. A Transformer can implement this interface so that
14: * when a transformation is being 'discovered' for a payload type the transformers implementing this interface
15: * will be included in the search. A 'priorityWeighting property is introduced with this interface that can be used
16: * to help select a transformer when there are two or more matches. The transformer with the highest priorityWeighting
17: * will be selected.
18: */
19: public interface DiscoverableTransformer {
20: public static final int MAX_PRIORITY_WEIGHTING = 10;
21: public static final int MIN_PRIORITY_WEIGHTING = 1;
22: public static final int DEFAULT_PRIORITY_WEIGHTING = MIN_PRIORITY_WEIGHTING;
23:
24: /**
25: * If 2 or more discoverable transformers are equal, this value can be used to select the correct one
26: *
27: * @return the priority weighting for this transformer. This is a value between
28: * {@link #MIN_PRIORITY_WEIGHTING} and {@link #MAX_PRIORITY_WEIGHTING}.
29: */
30: public int getPriorityWeighting();
31:
32: /**
33: * If 2 or more discoverable transformers are equal, this value can be used to select the correct one
34: *
35: * @param weighting the priority weighting for this transformer. This is a value between
36: * {@link #MIN_PRIORITY_WEIGHTING} and {@link #MAX_PRIORITY_WEIGHTING}.
37: */
38: public void setPriorityWeighting(int weighting);
39: }
|