01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.slice;
20:
21: import java.util.Map;
22:
23: import org.apache.openjpa.conf.OpenJPAProductDerivation;
24: import org.apache.openjpa.lib.conf.AbstractProductDerivation;
25: import org.apache.openjpa.slice.jdbc.DistributedJDBCBrokerFactory;
26:
27: /**
28: * Derives configuration for Slice.
29: * Introduces a specialized BrokerFactory aliased as <code>slice</code>.
30: * All Slice specific configuration is prefixed as
31: * <code>openjpa.slice.*.*</code>
32: *
33: * @author Pinaki Poddar
34: *
35: */
36: public class ProductDerivation extends AbstractProductDerivation
37: implements OpenJPAProductDerivation {
38: /**
39: * Prefix for all Slice-specific configuration properties.
40: */
41: public static final String PREFIX_SLICE = "openjpa.slice";
42:
43: /**
44: * Hint key <code>openjpa.hint.slice.Target </code> to specify a subset of
45: * slices for query. The value corresponding to the key is comma-separated
46: * list of slice identifiers.
47: *
48: */
49: public static final String HINT_TARGET = "openjpa.hint.slice.Target";
50:
51: @SuppressWarnings("unchecked")
52: public void putBrokerFactoryAliases(Map m) {
53: m.put("slice", DistributedJDBCBrokerFactory.class.getName());
54: }
55:
56: public String getConfigurationPrefix() {
57: return PREFIX_SLICE;
58: }
59:
60: public int getType() {
61: return TYPE_FEATURE;
62: }
63: }
|