01: /**********************************************************************
02: Copyright (c) 2006 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: ...
18: **********************************************************************/package org.jpox.store.poid;
19:
20: import java.util.Properties;
21:
22: import org.jpox.store.StoreManager;
23: import org.jpox.store.poid.AbstractPoidGenerator;
24: import org.jpox.store.poid.PoidConnectionProvider;
25:
26: /**
27: * Abstract representation of a PoidGenerator for a datastore.
28: * Builds on the base AbstractPoidGenerator, and providing datastore connection
29: * and StoreManager information.
30: *
31: * @version $Revision: 1.2 $
32: */
33: public abstract class AbstractDatastorePoidGenerator extends
34: AbstractPoidGenerator {
35: /** Manager for the datastore. */
36: protected StoreManager storeMgr;
37:
38: /** The means of connecting to the datastore (if required by the generator). */
39: protected PoidConnectionProvider connectionProvider;
40:
41: /**
42: * Constructor.
43: * @param name Symbolic name for the generator
44: * @param props Properties controlling the behaviour of the generator
45: */
46: public AbstractDatastorePoidGenerator(String name, Properties props) {
47: super (name, props);
48: allocationSize = 1;
49: }
50:
51: /**
52: * Method to set the StoreManager to be used.
53: * @param storeMgr The Store Manager
54: */
55: public void setStoreManager(StoreManager storeMgr) {
56: this .storeMgr = storeMgr;
57: }
58:
59: /**
60: * Mutator for setting the connection provider.
61: * @param provider The connection provider.
62: */
63: public void setConnectionProvider(PoidConnectionProvider provider) {
64: connectionProvider = provider;
65: }
66: }
|