01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.server;
12:
13: import com.versant.core.common.OID;
14: import com.versant.core.common.State;
15: import com.versant.core.metadata.FetchGroup;
16: import com.versant.core.common.OID;
17:
18: /**
19: * Classes that can receive extra states from a DataStore implement this.
20: */
21: public interface StateReceiver {
22:
23: /**
24: * This is a callback for DataStore instances to use when they have
25: * additional data above that requested.
26: *
27: * @param fetchGroup This is relative to the class of oid
28: * @return True if the receiver may accept a State for the oid. The store
29: * should construct a State and call addState. If this is false then
30: * the store should discard its extra data. This two step process prevents
31: * the construction of unecessary State objects.
32: * @see #addState
33: */
34: public boolean isStateRequired(OID oid, FetchGroup fetchGroup);
35:
36: /**
37: * This is a callback for DataStore instances to use when they have
38: * additional data they want to provide.
39: *
40: * @see #isStateRequired
41: */
42: public void addState(OID oid, State state);
43: }
|